summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-28 12:21:55 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-07-28 12:22:35 (GMT)
commite0d8da383fccbbe7069ac364cb7ca0e63b3d062d (patch)
treef6eaeffd39c700801e60339f4769726d234a3941 /Modules
parent738f89f1ec0631b5282c375dd541af19084183ec (diff)
parente67d9c6e3139ec545cc90935e0d2cf7b97f1b709 (diff)
downloadCMake-e0d8da383fccbbe7069ac364cb7ca0e63b3d062d.zip
CMake-e0d8da383fccbbe7069ac364cb7ca0e63b3d062d.tar.gz
CMake-e0d8da383fccbbe7069ac364cb7ca0e63b3d062d.tar.bz2
Merge topic 'sysroot-prefix'
e67d9c6e31 Compilers: Ignore -print-sysroot prefix when it is '/' Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5066
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompiler.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 7cd7c47..cb1ab1d 100644
--- a/Modules/CMakeDetermineCompiler.cmake
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -140,7 +140,9 @@ function(_cmake_find_compiler_sysroot lang)
OUTPUT_VARIABLE _cmake_sysroot_run_out
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")
+ if(_cmake_sysroot_run_out AND NOT _cmake_sysroot_run_err
+ AND NOT _cmake_sysroot_run_out STREQUAL "/"
+ AND IS_DIRECTORY "${_cmake_sysroot_run_out}/usr")
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()