llvm.org GIT mirror llvm / 3d91fe7
[CMake] Provide an option to disable runtimes build This could be used to either disable the runtimes build altogether or avoid building them but still generate the build targets. Differential Revision: https://reviews.llvm.org/D31060 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298653 91177308-0d34-0410-b5e6-96231b3b80d8 Petr Hosek 3 years ago
2 changed file(s) with 17 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
482482 option(LLVM_BUILD_UTILS
483483 "Build LLVM utility binaries. If OFF, just generate build targets." ON)
484484
485 option(LLVM_INCLUDE_RUNTIMES "Generate build targets for the LLVM runtimes." ON)
486 option(LLVM_BUILD_RUNTIMES
487 "Build the LLVM runtimes. If OFF, just generate build targets." ON)
488
485489 option(LLVM_BUILD_RUNTIME
486490 "Build the LLVM runtime libraries." ON)
487491 option(LLVM_BUILD_EXAMPLES
861865 add_subdirectory(tools)
862866 endif()
863867
864 add_subdirectory(runtimes)
868 if( LLVM_INCLUDE_RUNTIMES )
869 add_subdirectory(runtimes)
870 endif()
865871
866872 if( LLVM_INCLUDE_EXAMPLES )
867873 add_subdirectory(examples)
144144 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${LLVM_BINARY_DIR}/runtimes/Components.cmake)
145145 include(LLVMExternalProjectUtils)
146146
147 if(NOT LLVM_BUILD_RUNTIMES)
148 set(EXTRA_ARGS EXCLUDE_FROM_ALL)
149 endif()
150
147151 # If compiler-rt is present we need to build the builtin libraries first. This
148152 # is required because the other runtimes need the builtin libraries present
149153 # before the just-built compiler can pass the configuration tests.
156160 -DCMAKE_C_COMPILER_TARGET=${TARGET_TRIPLE}
157161 -DCMAKE_ASM_COMPILER_TARGET=${TARGET_TRIPLE}
158162 PASSTHROUGH_PREFIXES COMPILER_RT
159 USE_TOOLCHAIN)
163 USE_TOOLCHAIN
164 ${EXTRA_ARGS})
160165 else()
161166 get_cmake_property(variableNames VARIABLES)
162167 add_custom_target(builtins)
178183 -DCOMPILER_RT_DEFAULT_TARGET_ONLY=On
179184 ${${target}_extra_args}
180185 PASSTHROUGH_PREFIXES COMPILER_RT
181 USE_TOOLCHAIN)
186 USE_TOOLCHAIN
187 ${EXTRA_ARGS})
182188 add_dependencies(builtins builtins-${target})
183189 endforeach()
184190 endif()
237243 ${SUB_COMPONENTS}
238244 ${SUB_COMPONENT_CHECK_TARGETS}
239245 ${SUB_INSTALL_TARGETS}
240 USE_TOOLCHAIN)
246 USE_TOOLCHAIN
247 ${EXTRA_ARGS})
241248
242249 # TODO: This is a hack needed because the libcxx headers are copied into the
243250 # build directory during configuration. Without that step the clang in the