diff options
author | Alexander Neundorf <neundorf@kde.org> | 2008-09-07 16:54:01 -0400 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2008-09-07 16:54:01 -0400 |
commit | 281e441100caeb93c3308c034b030d1e50ec8a91 (patch) | |
tree | cc3bf4b1127f30a6e97ef4c337bc39bada00558e /Modules | |
parent | c2cc88343093ee65c6fe610f19c91435ec29527e (diff) | |
download | cmake-281e441100caeb93c3308c034b030d1e50ec8a91.tar.gz |
BUG: #7359 make llvm-gcc work, by explicitely excluding "llvm-" from _CMAKE_TOOLCHAIN_PREFIX
(use the (relatively) new CMAKE_MATCH_x variables set by all regex operations)
Alex
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCCompiler.cmake | 9 | ||||
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index ae68f1886e..85d6c46cd0 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -97,8 +97,15 @@ ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION) IF (NOT _CMAKE_TOOLCHAIN_PREFIX) GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$") - STRING(REGEX REPLACE "^(.+-)g?cc(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}") + SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$") + + # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils + # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) + IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX) diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 1cd401fc53..73378463d3 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -97,8 +97,15 @@ ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION) IF (NOT _CMAKE_TOOLCHAIN_PREFIX) GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$") - STRING(REGEX REPLACE "^(.+-)[gc]\\+\\+(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}") + SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$") + + # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils + # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) + IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX) # This block was used before the compiler was identified by building a |