[PATCH] D31060: [CMake] Provide an option to disable runtimes build

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 15:52:29 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL298653: [CMake] Provide an option to disable runtimes build (authored by phosek).

Changed prior to commit:
  https://reviews.llvm.org/D31060?vs=92072&id=92878#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D31060

Files:
  llvm/trunk/CMakeLists.txt
  llvm/trunk/runtimes/CMakeLists.txt


Index: llvm/trunk/CMakeLists.txt
===================================================================
--- llvm/trunk/CMakeLists.txt
+++ llvm/trunk/CMakeLists.txt
@@ -483,6 +483,10 @@
 option(LLVM_BUILD_UTILS
   "Build LLVM utility binaries. If OFF, just generate build targets." ON)
 
+option(LLVM_INCLUDE_RUNTIMES "Generate build targets for the LLVM runtimes." ON)
+option(LLVM_BUILD_RUNTIMES
+  "Build the LLVM runtimes. If OFF, just generate build targets." ON)
+
 option(LLVM_BUILD_RUNTIME
   "Build the LLVM runtime libraries." ON)
 option(LLVM_BUILD_EXAMPLES
@@ -862,7 +866,9 @@
   add_subdirectory(tools)
 endif()
 
-add_subdirectory(runtimes)
+if( LLVM_INCLUDE_RUNTIMES )
+  add_subdirectory(runtimes)
+endif()
 
 if( LLVM_INCLUDE_EXAMPLES )
   add_subdirectory(examples)
Index: llvm/trunk/runtimes/CMakeLists.txt
===================================================================
--- llvm/trunk/runtimes/CMakeLists.txt
+++ llvm/trunk/runtimes/CMakeLists.txt
@@ -145,6 +145,10 @@
   set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${LLVM_BINARY_DIR}/runtimes/Components.cmake)
   include(LLVMExternalProjectUtils)
 
+  if(NOT LLVM_BUILD_RUNTIMES)
+    set(EXTRA_ARGS EXCLUDE_FROM_ALL)
+  endif()
+
   # If compiler-rt is present we need to build the builtin libraries first. This
   # is required because the other runtimes need the builtin libraries present
   # before the just-built compiler can pass the configuration tests.
@@ -157,7 +161,8 @@
                                           -DCMAKE_C_COMPILER_TARGET=${TARGET_TRIPLE}
                                           -DCMAKE_ASM_COMPILER_TARGET=${TARGET_TRIPLE}
                                PASSTHROUGH_PREFIXES COMPILER_RT
-                               USE_TOOLCHAIN)
+                               USE_TOOLCHAIN
+                               ${EXTRA_ARGS})
     else()
       get_cmake_property(variableNames VARIABLES)
       add_custom_target(builtins)
@@ -179,7 +184,8 @@
                                           -DCOMPILER_RT_DEFAULT_TARGET_ONLY=On
                                           ${${target}_extra_args}
                                PASSTHROUGH_PREFIXES COMPILER_RT
-                               USE_TOOLCHAIN)
+                               USE_TOOLCHAIN
+                               ${EXTRA_ARGS})
         add_dependencies(builtins builtins-${target})
       endforeach()
     endif()
@@ -238,7 +244,8 @@
                                             ${SUB_COMPONENTS}
                                             ${SUB_COMPONENT_CHECK_TARGETS}
                                             ${SUB_INSTALL_TARGETS}
-                             USE_TOOLCHAIN)
+                             USE_TOOLCHAIN
+                             ${EXTRA_ARGS})
     
     # TODO: This is a hack needed because the libcxx headers are copied into the
     # build directory during configuration. Without that step the clang in the


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31060.92878.patch
Type: text/x-patch
Size: 2939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170323/0a14b63b/attachment.bin>


More information about the llvm-commits mailing list