[llvm] r318034 - Move the setting of LLVM_BUILD_MODE to a macro so that we can re-use it in compiler-rt

Greg Bedwell via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 04:40:06 PST 2017


Author: gbedwell
Date: Mon Nov 13 04:40:05 2017
New Revision: 318034

URL: http://llvm.org/viewvc/llvm-project?rev=318034&view=rev
Log:
Move the setting of LLVM_BUILD_MODE to a macro so that we can re-use it in compiler-rt

Differential Revision: https://reviews.llvm.org/D38470

Modified:
    llvm/trunk/cmake/modules/AddLLVM.cmake

Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=318034&r1=318033&r2=318034&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Mon Nov 13 04:40:05 2017
@@ -1124,6 +1124,15 @@ function(llvm_canonicalize_cmake_boolean
   endforeach()
 endfunction(llvm_canonicalize_cmake_booleans)
 
+macro(set_llvm_build_mode)
+  # Configuration-time: See Unit/lit.site.cfg.in
+  if (CMAKE_CFG_INTDIR STREQUAL ".")
+    set(LLVM_BUILD_MODE ".")
+  else ()
+    set(LLVM_BUILD_MODE "%(build_mode)s")
+  endif ()
+endmacro()
+
 # This function provides an automatic way to 'configure'-like generate a file
 # based on a set of common and custom variables, specifically targeting the
 # variables needed for the 'lit.site.cfg' files. This function bundles the
@@ -1147,12 +1156,7 @@ function(configure_lit_site_cfg site_in
 
   set(SHLIBEXT "${LTDL_SHLIB_EXT}")
 
-  # Configuration-time: See Unit/lit.site.cfg.in
-  if (CMAKE_CFG_INTDIR STREQUAL ".")
-    set(LLVM_BUILD_MODE ".")
-  else ()
-    set(LLVM_BUILD_MODE "%(build_mode)s")
-  endif ()
+  set_llvm_build_mode()
 
   # They below might not be the build tree but provided binary tree.
   set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})




More information about the llvm-commits mailing list