Sharpmake icon indicating copy to clipboard operation
Sharpmake copied to clipboard

C++20 scan sources for module

Open Cheaterdev opened this issue 2 years ago • 8 comments

Hello! For proper generating header units from regular header files, there is a switch in MSVC "ScanSourceForModuleDependencies" in the "ClCompile" block which is currently missing from Sharpmake.

Cheaterdev avatar Oct 07 '21 19:10 Cheaterdev

Heya! Sharpmake doesn't (yet) support c++20 modules. I'll leave this open till we look into it :) Thanks!

belkiss avatar Oct 11 '21 07:10 belkiss

Any plans or progress on the c++20 modules matter? Especially the "ForceCreateReferences" switch #146 would be great.

ChemistAion avatar Sep 29 '22 08:09 ChemistAion

Hey @belkiss - using a direct ping to ask the same question. Any progress made on module support? If not yet, is it on a roadmap anywhere or just sitting in todo status?

Thanks for any insights.

xoorath avatar Nov 11 '22 03:11 xoorath

Hey @belkiss - using a direct ping to ask the same question. Any progress made on module support? If not yet, is it on a roadmap anywhere or just sitting in todo status?

Thanks for any insights.

I'm able to use modules right now with dependencies from other projects with this simple change: https://github.com/ubisoft/Sharpmake/compare/dev...Cheaterdev:Sharpmake:dev#diff-3b4daac922926a117976678caf15dc7f785154add1e9fd2f3eab0eddf6f129d7

Cheaterdev avatar Nov 11 '22 05:11 Cheaterdev

I could only confirm what @Cheaterdev did, I am using his patch as-is to make Sharpmake work with c++20 modules in my project with no issues.

ChemistAion avatar Nov 12 '22 19:11 ChemistAion

Thanks both. For anyone else who stumbles over here you will also want to add the .ixx extension to the project.

(in project constructor):

SourceFilesExtensions.Add(".ixx");
SourceFilesCompileExtensions.Add(".ixx");

Other helpful settings for visual studio:

// "All Modules Are Public" from the VC++ Directories project page
CustomProperties.Add("AllProjectBMIsArePublic", "false");

// PublicModuleDirectories: "Public C++ Module Directories" from the VC++ Directories project page
CustomProperties.Add("PublicModuleDirectories", @"$(ProjectDir)..\Public");

xoorath avatar Nov 12 '22 22:11 xoorath

Heya!

Hey @belkiss - using a direct ping to ask the same question. Any progress made on module support? If not yet, is it on a roadmap anywhere or just sitting in todo status?

Thanks for any insights.

Nothing on the roadmap, modules are not something we have investigated yet internally. Note that my time at Ubisoft is coming to an end very shortly, so can't say if that's gonna change.

Thanks to the other contributors for the workarounds!

Cheers

belkiss avatar Nov 14 '22 08:11 belkiss

@belkiss: before you go... making a public branch with just this two-liner (literally) would lead to c++20 modules (virtually) free-testing by community - in the mean time... since you are not investigated this topic internally yet

ChemistAion avatar Nov 15 '22 18:11 ChemistAion

@Cheaterdev I have made a PR in your behalf - I am tired to "manually" add it every time I update the tool ;) https://github.com/ubisoft/Sharpmake/pull/253

ChemistAion avatar Mar 10 '23 19:03 ChemistAion