mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 11:22:21 -06:00
VS: Fix SLNX with multiple solution-to-project configuration mappings
Filter each mapping to apply only to its intended solution-wide config. Fixes: #27385
This commit is contained in:
@@ -319,6 +319,7 @@ void WriteSlnxProject(cmXMLElement& xmlParent, Solution const& solution,
|
||||
for (std::size_t i = 0; i < solution.Configs.size(); ++i) {
|
||||
if (project.Configs[i].Config != solution.Configs[i]) {
|
||||
cmXMLElement(xmlProject, "BuildType")
|
||||
.Attribute("Solution", cmStrCat(solution.Configs[i], "|*"))
|
||||
.Attribute("Project", project.Configs[i].Config);
|
||||
}
|
||||
if (!project.Configs[i].Build) {
|
||||
|
||||
@@ -19,6 +19,8 @@ RunCMake_check_slnx("${RunCMake_TEST_BINARY_DIR}/CustomConfig.slnx" [[
|
||||
<Project Path="ZERO_CHECK\.vcxproj" Id="[0-9a-f-]+"/>
|
||||
<Project Path="external.project" Id="aaa-bbb-ccc-000">
|
||||
<BuildDependency Project="ZERO_CHECK.vcxproj"/>
|
||||
<BuildType Project="Custom - Release"/>
|
||||
<BuildType Solution="Release\|\*" Project="Custom - Release"/>
|
||||
<BuildType Solution="MinSizeRel\|\*" Project="Custom - MinSizeRel"/>
|
||||
<BuildType Solution="RelWithDebInfo\|\*" Project="Custom - RelWithDebInfo"/>
|
||||
</Project>
|
||||
</Solution>$]])
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
include_external_msproject(external external.project
|
||||
GUID aaa-bbb-ccc-000)
|
||||
set_target_properties(external PROPERTIES MAP_IMPORTED_CONFIG_RELEASE "Custom - Release")
|
||||
set_target_properties(external PROPERTIES
|
||||
MAP_IMPORTED_CONFIG_RELEASE "Custom - Release"
|
||||
MAP_IMPORTED_CONFIG_MINSIZEREL "Custom - MinSizeRel"
|
||||
MAP_IMPORTED_CONFIG_RELWITHDEBINFO "Custom - RelWithDebInfo"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user