[compiler-rt] r205362 - Allow the user to override the compiler used for testing

Greg Fitzgerald gregf at codeaurora.org
Tue Apr 1 14:54:56 PDT 2014


Author: garious
Date: Tue Apr  1 16:54:56 2014
New Revision: 205362

URL: http://llvm.org/viewvc/llvm-project?rev=205362&view=rev
Log:
Allow the user to override the compiler used for testing

Change-Id: I76d4708a26f17185efb746f4b836aa32f3f8a44f

Modified:
    compiler-rt/trunk/CMakeLists.txt

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=205362&r1=205361&r2=205362&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Tue Apr  1 16:54:56 2014
@@ -59,7 +59,6 @@ if (NOT COMPILER_RT_STANDALONE_BUILD)
         ${LLVM_ENABLE_WERROR})
   # Use just-built Clang to compile/link tests.
   set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
-  set(COMPILER_RT_TEST_COMPILER_ID Clang)
 else()
   # Take output dir and install path from the user.
   set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH
@@ -71,8 +70,7 @@ else()
   option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF)
   option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF)
   # Use a host compiler to compile/link tests.
-  set(COMPILER_RT_TEST_COMPILER ${CMAKE_C_COMPILER})
-  set(COMPILER_RT_TEST_COMPILER_ID ${CMAKE_C_COMPILER_ID})
+  set(COMPILER_RT_TEST_COMPILER ${CMAKE_C_COMPILER} CACHE PATH "Compiler to use for testing")
 
   if (NOT LLVM_CONFIG_PATH)
     find_program(LLVM_CONFIG_PATH "llvm-config"
@@ -120,6 +118,12 @@ else()
   set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
 endif()
 
+if("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang[+]*$")
+  set(COMPILER_RT_TEST_COMPILER_ID Clang)
+else()
+  set(COMPILER_RT_TEST_COMPILER_ID GNU)
+endif()
+
 string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR)
 set(COMPILER_RT_LIBRARY_OUTPUT_DIR
   ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})





More information about the llvm-commits mailing list