summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-09-08 16:57:01 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-09-08 16:57:01 (GMT)
commitd11a19528ea70092a522ec327d8f3e3d364db7b7 (patch)
treefec670bf747732697f921c0b70decc103516b232 /Modules
parent1251c1c8c50fccbd73b48cf8b13b3432845fc320 (diff)
parent72d6681826840c0a14be61d19c71a55f280d38ae (diff)
downloadCMake-d11a19528ea70092a522ec327d8f3e3d364db7b7.zip
CMake-d11a19528ea70092a522ec327d8f3e3d364db7b7.tar.gz
CMake-d11a19528ea70092a522ec327d8f3e3d364db7b7.tar.bz2
Merge topic 'fix-clang-cross-compile-find-binutils'
72d66818 Fix finding binutils when cross-compiling with Clang
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake4
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake4
2 files changed, 6 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 3847b75..6b425c6 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -136,7 +136,9 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
if (COMPILER_BASENAME MATCHES "^(.+-)(clang|g?cc)(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
- set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_C_COMPILER_TARGET}-)
+ if(CMAKE_C_COMPILER_TARGET)
+ set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_C_COMPILER_TARGET}-)
+ endif()
elseif(COMPILER_BASENAME MATCHES "qcc(\\.exe)?$")
if(CMAKE_C_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?")
set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-)
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index e6a9d9a..893c454 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -133,7 +133,9 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
if (COMPILER_BASENAME MATCHES "^(.+-)(clan)?[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
- set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_CXX_COMPILER_TARGET}-)
+ if(CMAKE_CXX_COMPILER_TARGET)
+ set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_CXX_COMPILER_TARGET}-)
+ endif()
elseif(COMPILER_BASENAME MATCHES "QCC(\\.exe)?$")
if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?")
set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-)