ubisoft / Sharpmake

Sharpmake is an open-source C#-based solution for generating project definition files, such as Visual Studio projects and solutions, GNU makefiles, Xcode projects, etc.
Apache License 2.0
927 stars 171 forks source link

Patch for c++20 modules raw support #253

Open ChemistAion opened 1 year ago

ChemistAion commented 1 year ago

This is work of @cheaterdev, details are in: https://github.com/ubisoft/Sharpmake/issues/145 https://github.com/ubisoft/Sharpmake/issues/146

ChemistAion commented 1 year ago

This one-liner (by @Cheaterdev) allows to work with c++20 modules flawlessly, could you please do some regression tests on this? ...since @belkiss (involved in these discussions) stopped responding :|

jspelletier commented 1 year ago

belkiss is no longer working at ubisoft, sadly. I will take a look at this in the next few days.

ChemistAion commented 1 year ago

@jspelletier: ack, I appreciate it... waiting for yours analysis

jspelletier commented 1 year ago

this modifies a bunch of vcxproj and adds a lots of unwanted project reference to our vcxproj.

Why don't you instead set ExportAdditionalLibrariesEvenForStaticLib to true in your configurations? Would be equivalent to the if condition that you removed(I think). Or if this is not possible and doesn't work, would need to hide this new behavior behind some feature flag(possibly a new bool in Project.Configuration)

ChemistAion commented 1 year ago

I will conduct some tests based on your recommendation, give me a few hours.

Cheaterdev commented 1 year ago

this modifies a bunch of vcxproj and adds a lots of unwanted project reference to our vcxproj.

Why don't you instead set ExportAdditionalLibrariesEvenForStaticLib to true in your configurations? Would be equivalent to the if condition that you removed(I think). Or if this is not possible and doesn't work, would need to hide this new behavior behind some feature flag(possibly a new bool in Project.Configuration)

Because when having multiple projects with modules it starts exporting lib files as well and linker is going crazy - a lot of duplicates. We just need proper references between projects, nothing more.