diff options
author | Brad King <brad.king@kitware.com> | 2023-06-23 14:48:06 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-06-23 14:48:14 (GMT) |
commit | 5061ac9772a3d519641a66072d43fd500ba6cdc7 (patch) | |
tree | 03c53d65f69d3bd1e275c23b0a0cd5673dec791e | |
parent | 8801ce34c162411a19438c01828cae42cb01a5cb (diff) | |
parent | d90a61d671192fefd18a9c6152db8925a64b5035 (diff) | |
download | CMake-5061ac9772a3d519641a66072d43fd500ba6cdc7.zip CMake-5061ac9772a3d519641a66072d43fd500ba6cdc7.tar.gz CMake-5061ac9772a3d519641a66072d43fd500ba6cdc7.tar.bz2 |
Merge topic 'vs-cxxmodules-public-bmis' into release-3.27
d90a61d671 VS: Make C++ module BMIs public by default for shared libraries
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8549
-rw-r--r-- | .gitlab/ci/configure_windows_vs2022_x64.cmake | 2 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 24 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.h | 1 |
3 files changed, 26 insertions, 1 deletions
diff --git a/.gitlab/ci/configure_windows_vs2022_x64.cmake b/.gitlab/ci/configure_windows_vs2022_x64.cmake index 290d380..51ee514 100644 --- a/.gitlab/ci/configure_windows_vs2022_x64.cmake +++ b/.gitlab/ci/configure_windows_vs2022_x64.cmake @@ -1,4 +1,4 @@ -set(CMake_TEST_MODULE_COMPILATION "named,partitions,internal_partitions" CACHE STRING "") +set(CMake_TEST_MODULE_COMPILATION "named,partitions,internal_partitions,shared" CACHE STRING "") include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_msvc_cxx_modules_common.cmake") include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common.cmake") diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 7975018..33152f2 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); @@ -3115,6 +3116,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) { diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index a87cb01..ffab91f 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -97,6 +97,7 @@ private: void WriteWinRTPackageCertificateKeyFile(Elem& e0); void WriteXamlFilesGroup(Elem& e0); void WritePathAndIncrementalLinkOptions(Elem& e0); + void WritePublicProjectContentOptions(Elem& e0); void WriteItemDefinitionGroups(Elem& e0); void VerifyNecessaryFiles(); void WriteMissingFiles(Elem& e1); |