Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ Object file conflicts when .cpp files have different folder but same name #1182

Closed
vlmillet opened this issue Oct 19, 2018 · 2 comments · Fixed by #1191
Closed

C++ Object file conflicts when .cpp files have different folder but same name #1182

vlmillet opened this issue Oct 19, 2018 · 2 comments · Fixed by #1191

Comments

@vlmillet
Copy link

I'm having an issue on our project where two cpp with the same name, while being in different folders, generate object files that collide because output in the same folder.
Even if visual studio is a part responsible for that, it would be nice and a service we would expect from premake to auto detect these kind of conflicts and create specific build commands for the conflicting files to output the object files in different folders. (I remember that CMake does this)

@ratzlaff
Copy link
Contributor

What version of premake are you using? The one I am using (some point after alpha 12) detects this case of file names being the same.

@ratzlaff
Copy link
Contributor

ratzlaff commented Nov 2, 2018

Just verified with a build of premake-core @ ed483dd

files {	"dir1/file.cpp"
,	"dir2/file.cpp"
}

produces the following in the .vcxproj

<ItemGroup>
  <ClCompile Include="dir1\file.cpp" />
  <ClCompile Include="dir2\file.cpp">
    <ObjectFileName>$(IntDir)\file1.obj</ObjectFileName>
  </ClCompile>
</ItemGroup>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants