diff options
author | Brad King <brad.king@kitware.com> | 2024-04-11 12:35:24 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-04-11 12:35:34 (GMT) |
commit | 85f501ed59cb3df68bffc713cd3cfc62ad878f55 (patch) | |
tree | 504325ec02a5418b010ff724b958d463e020257c /Source/cmGlobalGenerator.cxx | |
parent | 17b3051b85de34621939a3b7a30cafee42476c47 (diff) | |
parent | 26e79ed299704f8931131e99639e76f4aa0ee023 (diff) | |
download | CMake-85f501ed59cb3df68bffc713cd3cfc62ad878f55.zip CMake-85f501ed59cb3df68bffc713cd3cfc62ad878f55.tar.gz CMake-85f501ed59cb3df68bffc713cd3cfc62ad878f55.tar.bz2 |
Merge topic 'compiler-path-normalization' into release-3.29
26e79ed299 Fix regression on reconfigure with unnormalized -DCMAKE_<LANG>_COMPILER=
1d485a8b45 Tests/RunCMake/CompilerChange: Simplify test cases
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Ashay Rane <ashay.r@gmail.com>
Merge-request: !9416
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 185bff9..1606eec 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -28,6 +28,7 @@ #include "cm_codecvt_Encoding.hxx" #include "cmAlgorithms.h" +#include "cmCMakePath.h" #include "cmCPackPropertiesGenerator.h" #include "cmComputeTargetDepends.h" #include "cmCryptoHash.h" @@ -270,17 +271,14 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string& lang, std::string changeVars; if (cname && !optional) { - std::string cnameString; + cmCMakePath cachedPath; if (!cmSystemTools::FileIsFullPath(*cname)) { - cnameString = cmSystemTools::FindProgram(*cname); + cachedPath = cmSystemTools::FindProgram(*cname); } else { - cnameString = *cname; + cachedPath = *cname; } - std::string pathString = path; - // get rid of potentially multiple slashes: - cmSystemTools::ConvertToUnixSlashes(cnameString); - cmSystemTools::ConvertToUnixSlashes(pathString); - if (cnameString != pathString) { + cmCMakePath foundPath = path; + if (foundPath.Normal() != cachedPath.Normal()) { cmValue cvars = this->GetCMakeInstance()->GetState()->GetGlobalProperty( "__CMAKE_DELETE_CACHE_CHANGE_VARS_"); if (cvars) { |