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

Same source filenames leads to obj outputs overwritten #264

Closed
ChemistAion opened this issue Apr 6, 2023 · 1 comment
Closed

Same source filenames leads to obj outputs overwritten #264

ChemistAion opened this issue Apr 6, 2023 · 1 comment

Comments

@ChemistAion
Copy link

ChemistAion commented Apr 6, 2023

I am playing with such a project lately:
https://github.com/GPUOpen-LibrariesAndSDKs/RenderPipelineShaders/tree/main/src/runtime/common

There is a case with two rps_rpsl_host sources expressed as a c and cpp with the same filename stem (within the same directory), respetivielly:

  • rps_rpsl_host.c
  • rps_rpsl_host.cpp

In the project CMake is used, which automatically detects such a combo and generates, full name-scope for these two files:

  • rps_rpsl_host.c.obj
  • rps_rpsl_host.cpp.obj

It is done by pointing out ObjectFileName property to the full filename in vcxproj, only for these two files, i.e.:
<ClCompile Include="D:\___rps\src\runtime\common\rps_rpsl_host.c">
<ObjectFileName>$(IntDir)/runtime/common/rps_rpsl_host.c.obj</ObjectFileName>
</ClCompile>

Is there a way to point out ObjectFileName per source-file in Sharpmake?

@belkiss
Copy link
Contributor

belkiss commented Apr 12, 2023

You can use conf.ObjectFileName to remap the object file name for those duplicates.

Read the comment carefully, as it can slow down the compile time :)

public Func<string, string> ObjectFileName = null;

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

No branches or pull requests

2 participants