[PATCH] D131665: [CMake] Support passing arguments to build tool (bootstrap).
Carlos Alberto Enciso via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 11 03:43:51 PDT 2022
CarlosAlbertoEnciso created this revision.
CarlosAlbertoEnciso added reviewers: andrewng, phosek, beanz, russell.gallop.
CarlosAlbertoEnciso added a project: LLVM.
Herald added a subscriber: mgorny.
Herald added a project: All.
CarlosAlbertoEnciso requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
For bootstrap builds (CLANG_ENABLE_BOOTSTRAP=ON) allow
arguments to be passed to the native tool used in CMake
for the stage2 step.
Can be used to pass extra arguments for enhanced versions
of build tools, e.g. distributed build options.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D131665
Files:
clang/CMakeLists.txt
Index: clang/CMakeLists.txt
===================================================================
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -787,6 +787,14 @@
endif()
endforeach()
+ # Build arguments for native tool used in CMake.
+ set(build_configuration "$<CONFIG>")
+ set(build_tool_args "${LLVM_EXTERNAL_PROJECT_BUILD_TOOL_ARGS}")
+ if(NOT build_tool_args STREQUAL "")
+ string(PREPEND build_tool_args "-- ")
+ separate_arguments(build_tool_args UNIX_COMMAND "${build_tool_args}")
+ endif()
+
ExternalProject_Add(${NEXT_CLANG_STAGE}
DEPENDS clang-bootstrap-deps
PREFIX ${NEXT_CLANG_STAGE}
@@ -809,6 +817,9 @@
${${CLANG_STAGE}_RANLIB}
${${CLANG_STAGE}_OBJCOPY}
${${CLANG_STAGE}_STRIP}
+ BUILD_COMMAND ${CMAKE_COMMAND} --build ${BINARY_DIR}
+ --config ${build_configuration}
+ ${build_tool_args}
INSTALL_COMMAND ""
STEP_TARGETS configure build
USES_TERMINAL_CONFIGURE 1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131665.451795.patch
Type: text/x-patch
Size: 1052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220811/abf37884/attachment-0001.bin>
More information about the cfe-commits
mailing list