r250196 - [CMake] When building clang as an external project we should pass through all variables that start with COMPILER_RT

Chris Bieneman via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 13 11:17:30 PDT 2015


Author: cbieneman
Date: Tue Oct 13 13:17:30 2015
New Revision: 250196

URL: http://llvm.org/viewvc/llvm-project?rev=250196&view=rev
Log:
[CMake] When building clang as an external project we should pass through all variables that start with COMPILER_RT

Modified:
    cfe/trunk/runtime/CMakeLists.txt

Modified: cfe/trunk/runtime/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/runtime/CMakeLists.txt?rev=250196&r1=250195&r2=250196&view=diff
==============================================================================
--- cfe/trunk/runtime/CMakeLists.txt (original)
+++ cfe/trunk/runtime/CMakeLists.txt Tue Oct 13 13:17:30 2015
@@ -44,6 +44,16 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND E
     COMMENT "Clobberring compiler-rt build and stamp directories"
     )
 
+  # Find all variables that start with COMPILER_RT and populate a variable with
+  # them.
+  get_cmake_property(variableNames VARIABLES)
+  foreach(varaibleName ${variableNames})
+    if(${varaibleName} MATCHES "^COMPILER_RT")
+      list(APPEND COMPILER_RT_PASSTHROUGH_VARIABLES
+        -D${varaibleName}=${${varaibleName}})
+    endif()
+  endforeach()
+
   ExternalProject_Add(compiler-rt
     PREFIX ${COMPILER_RT_PREFIX}
     SOURCE_DIR ${COMPILER_RT_SRC_ROOT}
@@ -59,6 +69,7 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND E
                -DCOMPILER_RT_INSTALL_PATH=${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}
                -DCOMPILER_RT_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
                -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
+               ${COMPILER_RT_PASSTHROUGH_VARIABLES}
     INSTALL_COMMAND ""
     STEP_TARGETS configure build
     ${cmake_3_4_USES_TERMINAL_OPTIONS}




More information about the cfe-commits mailing list