diff options
author | Brad King <brad.king@kitware.com> | 2020-05-06 12:23:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-05-06 12:25:58 (GMT) |
commit | 2e831e4a17b387f733dc18b06ebcecd775a774dd (patch) | |
tree | 655aea6f50df93602e958c227613825cbce72138 /Modules/CMakeDetermineCompiler.cmake | |
parent | 00065e2087ffd854a364507dcd84ef095aff1cc9 (diff) | |
download | CMake-2e831e4a17b387f733dc18b06ebcecd775a774dd.zip CMake-2e831e4a17b387f733dc18b06ebcecd775a774dd.tar.gz CMake-2e831e4a17b387f733dc18b06ebcecd775a774dd.tar.bz2 |
Windows: Normalize slashes in compiler -print-sysroot path
Since commit 8cc384f629 (Compilers: Add paths from -print-sysroot to
system prefix path, 2020-03-25) we detect the compiler `-print-sysroot`
output and save it. On Windows, the value may include backslashes.
Convert the path to CMake's forward-slash convention for storage.
Fixes: #20679
Diffstat (limited to 'Modules/CMakeDetermineCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompiler.cmake | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index da93b5c..7cd7c47 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -141,7 +141,8 @@ function(_cmake_find_compiler_sysroot lang) ERROR_VARIABLE _cmake_sysroot_run_err) if(_cmake_sysroot_run_out AND NOT _cmake_sysroot_run_err AND IS_DIRECTORY "${_cmake_sysroot_run_out}/usr") - set(CMAKE_${lang}_COMPILER_SYSROOT "${_cmake_sysroot_run_out}/usr" PARENT_SCOPE) + file(TO_CMAKE_PATH "${_cmake_sysroot_run_out}/usr" _cmake_sysroot_run_out_usr) + set(CMAKE_${lang}_COMPILER_SYSROOT "${_cmake_sysroot_run_out_usr}" PARENT_SCOPE) else() set(CMAKE_${lang}_COMPILER_SYSROOT "" PARENT_SCOPE) endif() |