MSVC: Define _WINDLL consistently for shared libraries

Visual Studio defines this automatically for `.dll` targets.
For consistency, define it when compiling for the MSVC ABI
with other generators.  Add policy CMP0203 for compatibility.

Fixes: #27253
This commit is contained in:
AJIOB
2025-09-16 13:40:04 +03:00
committed by Brad King
parent 206fcbb392
commit 83bbde5449
43 changed files with 268 additions and 45 deletions
+4
View File
@@ -1859,6 +1859,10 @@ std::set<BT<std::string>> cmLocalGenerator::GetTargetDefines(
if (std::string const* exportMacro = target->GetExportMacro()) {
this->AppendDefines(defines, *exportMacro);
}
for (auto const& sharedLibCompileDef :
target->GetSharedLibraryCompileDefs(config)) {
this->AppendDefines(defines, sharedLibCompileDef);
}
// Add preprocessor definitions for this target and configuration.
std::vector<BT<std::string>> targetDefines =