[PATCH] D131665: [CMake] Support passing arguments to build tool (bootstrap).

2022-08-22 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added a comment.

In D131665#3740037 , @phosek wrote:

> LGTM

@phosek Thanks for your review.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131665/new/

https://reviews.llvm.org/D131665

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D131665: [CMake] Support passing arguments to build tool (bootstrap).

2022-08-22 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6c6c4f6a9b3e: [CMake] Support passing arguments to build 
tool (bootstrap). (authored by CarlosAlbertoEnciso).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131665/new/

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 "$")
+  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


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 "$")
+  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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D131665: [CMake] Support passing arguments to build tool (bootstrap).

2022-08-22 Thread Petr Hosek via Phabricator via cfe-commits
phosek accepted this revision.
phosek added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131665/new/

https://reviews.llvm.org/D131665

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D131665: [CMake] Support passing arguments to build tool (bootstrap).

2022-08-22 Thread Andrew Ng via Phabricator via cfe-commits
andrewng resigned from this revision.
andrewng added a comment.

Resign as reviewer as I also work with Carlos and helped to author this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131665/new/

https://reviews.llvm.org/D131665

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D131665: [CMake] Support passing arguments to build tool (bootstrap).

2022-08-22 Thread Russell Gallop via Phabricator via cfe-commits
russell.gallop resigned from this revision.
russell.gallop added a comment.

Resign as reviewer as I work with Carlos (and am not familiar enough with the 
details of this area).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131665/new/

https://reviews.llvm.org/D131665

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D131665: [CMake] Support passing arguments to build tool (bootstrap).

2022-08-19 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added a comment.

To give more scope to the reviewers, the following CMake options illustrate the 
benefit of this patch.

For example, if I want to do a dry run on stage-2, I will pass 
`-DLLVM_EXTERNAL_PROJECT_BUILD_TOOL_ARGS="-n --verbose"`

  -DCLANG_ENABLE_BOOTSTRAP=ON -DLLVM_ENABLE_PROJECTS=clang 
-DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86 -G"Ninja" 
-DLLVM_EXTERNAL_PROJECT_BUILD_TOOL_ARGS="-n --verbose"

When `ninja` builds `stage-2` it receives the additional `-n` and `--verbose` 
options.

The `build_tool_args` passed to `BUILD_COMMAND` looks like:

  '--;-n;--verbose'


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131665/new/

https://reviews.llvm.org/D131665

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D131665: [CMake] Support passing arguments to build tool (bootstrap).

2022-08-11 Thread Russell Gallop via Phabricator via cfe-commits
russell.gallop added a comment.

Noting related review: https://reviews.llvm.org/D115815 which added this 
variable to support this for other "external projects".


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131665/new/

https://reviews.llvm.org/D131665

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D131665: [CMake] Support passing arguments to build tool (bootstrap).

2022-08-11 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
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 "$")
+  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


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 "$")
+  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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits