summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMichael Hirsch <scivision@users.noreply.github.com>2023-12-02 23:30:00 (GMT)
committerscivision <scivision@users.noreply.github.com>2023-12-06 00:08:39 (GMT)
commit3f2a5971c02450e24bc8852a84dcd136fae5de18 (patch)
treebdc4e97f7b6ef013b0b7f15c498c8f0367a7002a /Modules
parent57b94595a3a0056aef1446ce1827dd945261d362 (diff)
downloadCMake-3f2a5971c02450e24bc8852a84dcd136fae5de18.zip
CMake-3f2a5971c02450e24bc8852a84dcd136fae5de18.tar.gz
CMake-3f2a5971c02450e24bc8852a84dcd136fae5de18.tar.bz2
Modules: CMAKE_*_COMPILER convert path to cmake path
Fixes #25456 Before this, CMake configure halted as the slashes were interpreted as invalid escape characters
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompiler.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 0e41829..fc0b714 100644
--- a/Modules/CMakeDetermineCompiler.cmake
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -120,6 +120,10 @@ macro(_cmake_find_compiler_path lang)
# CMAKE_${lang}_COMPILER and the rest as CMAKE_${lang}_COMPILER_ARG1
# Otherwise, preserve any existing CMAKE_${lang}_COMPILER_ARG1 that might
# have been saved by CMakeDetermine${lang}Compiler in a previous run.
+
+ # Necessary for Windows paths to avoid improper escaping of backslashes
+ cmake_path(CONVERT "${CMAKE_${lang}_COMPILER}" TO_CMAKE_PATH_LIST CMAKE_${lang}_COMPILER NORMALIZE)
+
list(LENGTH CMAKE_${lang}_COMPILER _CMAKE_${lang}_COMPILER_LENGTH)
if(_CMAKE_${lang}_COMPILER_LENGTH GREATER 1)
set(CMAKE_${lang}_COMPILER_ARG1 "${CMAKE_${lang}_COMPILER}")