mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-01 03:29:18 -05:00
VS: Make C++ module BMIs public by default for shared libraries
Enable the `AllProjectBMIsArePublic` option for shared libraries in the VS project files when building with C++20 modules support.
This commit is contained in:
@@ -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_msvc_cxx_modules_common.cmake")
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common.cmake")
|
||||||
|
|||||||
@@ -793,6 +793,7 @@ void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile(
|
|||||||
Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros");
|
Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros");
|
||||||
this->WriteWinRTPackageCertificateKeyFile(e0);
|
this->WriteWinRTPackageCertificateKeyFile(e0);
|
||||||
this->WritePathAndIncrementalLinkOptions(e0);
|
this->WritePathAndIncrementalLinkOptions(e0);
|
||||||
|
this->WritePublicProjectContentOptions(e0);
|
||||||
this->WriteCEDebugProjectConfigurationValues(e0);
|
this->WriteCEDebugProjectConfigurationValues(e0);
|
||||||
this->WriteItemDefinitionGroups(e0);
|
this->WriteItemDefinitionGroups(e0);
|
||||||
this->WriteCustomCommands(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(
|
void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
|
||||||
Elem& e1, std::string const& configName)
|
Elem& e1, std::string const& configName)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ private:
|
|||||||
void WriteWinRTPackageCertificateKeyFile(Elem& e0);
|
void WriteWinRTPackageCertificateKeyFile(Elem& e0);
|
||||||
void WriteXamlFilesGroup(Elem& e0);
|
void WriteXamlFilesGroup(Elem& e0);
|
||||||
void WritePathAndIncrementalLinkOptions(Elem& e0);
|
void WritePathAndIncrementalLinkOptions(Elem& e0);
|
||||||
|
void WritePublicProjectContentOptions(Elem& e0);
|
||||||
void WriteItemDefinitionGroups(Elem& e0);
|
void WriteItemDefinitionGroups(Elem& e0);
|
||||||
void VerifyNecessaryFiles();
|
void VerifyNecessaryFiles();
|
||||||
void WriteMissingFiles(Elem& e1);
|
void WriteMissingFiles(Elem& e1);
|
||||||
|
|||||||
Reference in New Issue
Block a user