Quellcode durchsuchen

CMakeDetermine(C|CXX)Compiler: Consider Clang compilers

Look for "clang" or "clang++" compiler executables so Clang will be used
when it is the only compiler available.  Prefer them last to avoid
changing compiler default preferences for existing scripts.
Brad King vor 13 Jahren
Ursprung
Commit
b708f1a2b9
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 1
      Modules/CMakeDetermineCCompiler.cmake
  2. 1 1
      Modules/CMakeDetermineCXXCompiler.cmake

+ 1 - 1
Modules/CMakeDetermineCCompiler.cmake

@@ -56,7 +56,7 @@ IF(NOT CMAKE_C_COMPILER)
   IF(CMAKE_C_COMPILER_INIT)
     SET(CMAKE_C_COMPILER_LIST ${CMAKE_C_COMPILER_INIT})
   ELSE(CMAKE_C_COMPILER_INIT)
-    SET(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gcc ${_CMAKE_TOOLCHAIN_PREFIX}cc cl bcc xlc)
+    SET(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gcc ${_CMAKE_TOOLCHAIN_PREFIX}cc cl bcc xlc clang)
   ENDIF(CMAKE_C_COMPILER_INIT)
 
   # Find the compiler.

+ 1 - 1
Modules/CMakeDetermineCXXCompiler.cmake

@@ -55,7 +55,7 @@ IF(NOT CMAKE_CXX_COMPILER)
   IF(CMAKE_CXX_COMPILER_INIT)
     SET(CMAKE_CXX_COMPILER_LIST ${CMAKE_CXX_COMPILER_INIT})
   ELSE(CMAKE_CXX_COMPILER_INIT)
-    SET(CMAKE_CXX_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ CC aCC cl bcc xlC)
+    SET(CMAKE_CXX_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ CC aCC cl bcc xlC clang++)
   ENDIF(CMAKE_CXX_COMPILER_INIT)
 
   # Find the compiler.