summaryrefslogtreecommitdiff
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorMatthew Voss <matthew.voss@sony.com>2023-03-01 09:49:03 -0800
committerBrad King <brad.king@kitware.com>2023-03-07 14:41:32 -0500
commitd3c4c6d630f25d988b1f4876d55e7e35b9bfb6da (patch)
tree8dfe8268323a9054ee56469dcc633ac7037b1228 /Modules/CMakeDetermineCompilerId.cmake
parent3d6075da4df6a4f93a835e446c2bbf29488f50bd (diff)
downloadcmake-d3c4c6d630f25d988b1f4876d55e7e35b9bfb6da.tar.gz
VS: Import default C++ props file before toolset-specific props file
This avoids overwriting toolset-specific settings like `VCRedistDir` with default settings. Fixes: #22420
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 1f89c74d20..0878dff2a4 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -401,6 +401,9 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
endif()
endif()
set(id_toolset_version_props "<Import Project=\"${CMAKE_GENERATOR_INSTANCE}\\VC\\Auxiliary\\Build${id_sep}${CMAKE_VS_PLATFORM_TOOLSET_VERSION}\\Microsoft.VCToolsVersion.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}.props\" />")
+ if(lang STREQUAL CXX OR lang STREQUAL C)
+ set(id_toolset_version_props "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />${id_toolset_version_props}")
+ endif()
unset(id_sep)
endif()
endif()