diff options
Diffstat (limited to 'Modules/CMakeDetermineCCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineCCompiler.cmake | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 275fc47..d564b1b 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -145,9 +145,9 @@ endif () # NAME_WE cannot be used since then this test will fail for names lile # "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" -if (CMAKE_CROSSCOMPILING - AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" - AND NOT _CMAKE_TOOLCHAIN_PREFIX) +if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) + + if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) @@ -158,6 +158,7 @@ if (CMAKE_CROSSCOMPILING if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) endif () + endif() endif () |