diff options
author | Brad King <brad.king@kitware.com> | 2020-07-27 13:07:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-07-27 14:53:43 (GMT) |
commit | e67d9c6e3139ec545cc90935e0d2cf7b97f1b709 (patch) | |
tree | e78afd488d70fb1d96bb210a03146a0efe9c6999 /Modules | |
parent | 7c99b7d5dafdbff264b5b8d7e96ec81f0c4892cd (diff) | |
download | CMake-e67d9c6e3139ec545cc90935e0d2cf7b97f1b709.zip CMake-e67d9c6e3139ec545cc90935e0d2cf7b97f1b709.tar.gz CMake-e67d9c6e3139ec545cc90935e0d2cf7b97f1b709.tar.bz2 |
Compilers: Ignore -print-sysroot prefix when it is '/'
Since commit 8cc384f629 (Compilers: Add paths from -print-sysroot to
system prefix path, 2020-03-25, v3.18.0-rc1~337^2) we prepend the
compiler's sysroot to `CMAKE_SYSTEM_PREFIX_PATH`. This does not
make sense when the prefix is just `/`, such as on Ubuntu 16.04's
system compiler.
Fixes: #21019
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCompiler.cmake | 4 |
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() |