summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 33152f2..8d6b024 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2778,6 +2778,8 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
}
}
+ bool isCppModule = false;
+
for (std::string const& config : this->Configurations) {
this->GeneratorTarget->NeedCxxModuleSupport(lang, config);
@@ -2801,6 +2803,7 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
if (fs && fs->GetType() == "CXX_MODULES"_s) {
if (lang == "CXX"_s) {
if (fs->GetType() == "CXX_MODULES"_s) {
+ isCppModule = true;
if (shouldScanForModules &&
this->GlobalGenerator->IsScanDependenciesSupported()) {
// ScanSourceforModuleDependencies uses 'cl /scanDependencies' and
@@ -2959,6 +2962,14 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
oh.OutputPreprocessorDefinitions(lang);
}
}
+
+ if (isCppModule && !objectName.empty()) {
+ std::string baseName = cmStrCat("$(IntDir)/", objectName);
+ cmStripSuffixIfExists(baseName, ".obj");
+ e2.Element("ModuleOutputFile", cmStrCat(baseName, ".ifc"));
+ e2.Element("ModuleDependenciesFile", cmStrCat(baseName, ".module.json"));
+ }
+
if (this->IsXamlSource(source->GetFullPath())) {
const std::string& fileName = source->GetFullPath();
e2.Element("DependentUpon",