mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-09 10:00:12 -05:00
VS: Add option for per-target PlatformToolset
Add a `VS_PLATFORM_TOOLSET` target property to set `PlatformToolset` in the `.vcxproj` file for specific targets. Document that this is safe only when the named toolset uses the same underlying compiler as the primary toolset. Fixes: #17429
This commit is contained in:
@@ -1236,7 +1236,10 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
|
||||
} else {
|
||||
e1.Element("CharacterSet", "MultiByte");
|
||||
}
|
||||
if (const char* toolset = gg->GetPlatformToolset()) {
|
||||
if (const char* projectToolsetOverride =
|
||||
this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) {
|
||||
e1.Element("PlatformToolset", projectToolsetOverride);
|
||||
} else if (const char* toolset = gg->GetPlatformToolset()) {
|
||||
e1.Element("PlatformToolset", toolset);
|
||||
}
|
||||
if (this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
|
||||
@@ -1279,7 +1282,10 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
|
||||
o.RemoveFlag("Platform");
|
||||
}
|
||||
|
||||
if (const char* toolset = gg->GetPlatformToolset()) {
|
||||
if (const char* projectToolsetOverride =
|
||||
this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) {
|
||||
e1.Element("PlatformToolset", projectToolsetOverride);
|
||||
} else if (const char* toolset = gg->GetPlatformToolset()) {
|
||||
e1.Element("PlatformToolset", toolset);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user