summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-06-23 14:48:06 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-06-23 14:48:15 (GMT)
commit93c379430d0c48e4566b7f911f8ee483142f1c17 (patch)
treea2f39671a813329e92e210bba915c556bef6aa82 /Source/cmVisualStudio10TargetGenerator.cxx
parent5c9eb07dd2ede303af7818f0256e76c8753977d9 (diff)
parentd90a61d671192fefd18a9c6152db8925a64b5035 (diff)
downloadCMake-93c379430d0c48e4566b7f911f8ee483142f1c17.zip
CMake-93c379430d0c48e4566b7f911f8ee483142f1c17.tar.gz
CMake-93c379430d0c48e4566b7f911f8ee483142f1c17.tar.bz2
Merge topic 'vs-cxxmodules-public-bmis'
d90a61d671 VS: Make C++ module BMIs public by default for shared libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8549
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 5887ca2..dd6c4b8 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -793,6 +793,7 @@ void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile(
Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros");
this->WriteWinRTPackageCertificateKeyFile(e0);
this->WritePathAndIncrementalLinkOptions(e0);
+ this->WritePublicProjectContentOptions(e0);
this->WriteCEDebugProjectConfigurationValues(e0);
this->WriteItemDefinitionGroups(e0);
this->WriteCustomCommands(e0);
@@ -3103,6 +3104,29 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(
}
}
+void cmVisualStudio10TargetGenerator::WritePublicProjectContentOptions(
+ Elem& e0)
+{
+ cmStateEnums::TargetType ttype = this->GeneratorTarget->GetType();
+ if (ttype != cmStateEnums::SHARED_LIBRARY) {
+ return;
+ }
+ if (this->ProjectType != VsProjectType::vcxproj) {
+ return;
+ }
+
+ Elem e1(e0, "PropertyGroup");
+ for (std::string const& config : this->Configurations) {
+ if (this->GeneratorTarget->HaveCxx20ModuleSources() &&
+ this->GeneratorTarget->HaveCxxModuleSupport(config) ==
+ cmGeneratorTarget::Cxx20SupportLevel::Supported) {
+ const std::string cond = this->CalcCondition(config);
+ // For DLL projects, we export all BMIs for now
+ e1.WritePlatformConfigTag("AllProjectBMIsArePublic", cond, "true");
+ }
+ }
+}
+
void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
Elem& e1, std::string const& configName)
{