mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 05:50:42 +00:00
VS: Fix support for v142 toolset minor versions in VS 16.5+
The fix in commit 5117389931
(VS: Fix support for v142 toolset minor
versions, 2019-10-01, v3.15.5~6^2) worked around a bug in VS's placement
of toolset files. VS 16.5 will fix that bug and restore the original
pattern for locations of toolset files. Update our logic to look for
both possibilities.
Issue: #19779
This commit is contained in:
parent
2a5e5b25ba
commit
07612646fe
@ -284,10 +284,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
|
||||
set(id_cl icl.exe)
|
||||
endif()
|
||||
if(CMAKE_VS_PLATFORM_TOOLSET_VERSION)
|
||||
if(CMAKE_VS_PLATFORM_TOOLSET_VERSION VERSION_GREATER_EQUAL "14.20")
|
||||
set(id_sep ".")
|
||||
else()
|
||||
set(id_sep "\\")
|
||||
if(CMAKE_VS_PLATFORM_TOOLSET_VERSION VERSION_GREATER_EQUAL "14.20")
|
||||
if(EXISTS "${CMAKE_GENERATOR_INSTANCE}/VC/Auxiliary/Build.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}/Microsoft.VCToolsVersion.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}.props")
|
||||
set(id_sep ".")
|
||||
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\" />")
|
||||
unset(id_sep)
|
||||
|
@ -388,15 +388,17 @@ std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const
|
||||
if (version) {
|
||||
std::string instancePath;
|
||||
GetVSInstance(instancePath);
|
||||
std::stringstream path;
|
||||
path << instancePath;
|
||||
path << "/VC/Auxiliary/Build";
|
||||
path << (cmSystemTools::VersionCompareGreaterEq(version, "14.20") ? '.'
|
||||
: '/');
|
||||
path << version;
|
||||
path << "/Microsoft.VCToolsVersion." << version << ".props";
|
||||
|
||||
std::string toolsetPath = path.str();
|
||||
std::string toolsetDir = instancePath + "/VC/Auxiliary/Build";
|
||||
char sep = '/';
|
||||
if (cmSystemTools::VersionCompareGreaterEq(version, "14.20")) {
|
||||
std::string toolsetDot = toolsetDir + "." + version +
|
||||
"/Microsoft.VCToolsVersion." + version + ".props";
|
||||
if (cmSystemTools::PathExists(toolsetDot)) {
|
||||
sep = '.';
|
||||
}
|
||||
}
|
||||
std::string toolsetPath = toolsetDir + sep + version +
|
||||
"/Microsoft.VCToolsVersion." + version + ".props";
|
||||
cmSystemTools::ConvertToUnixSlashes(toolsetPath);
|
||||
return toolsetPath;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user