[PATCH] D132883: [cmake] Don't include symlinks to tools in Build-all when `LLVM_BUILD_TOOLS` is off

Markus Böck via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 05:46:53 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG52d7c0b760a1: [cmake] Don't include symlinks to tools in Build-all when `LLVM_BUILD_TOOLS` is… (authored by zero9178).

Changed prior to commit:
  https://reviews.llvm.org/D132883?vs=456617&id=456636#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132883

Files:
  llvm/cmake/modules/AddLLVM.cmake


Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -2135,7 +2135,14 @@
     add_custom_command(OUTPUT ${output_path}
                      COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${dest_binary}" "${output_path}"
                      DEPENDS ${target})
-    add_custom_target(${target_name} ALL DEPENDS ${target} ${output_path})
+
+    # TODO: Make use of generator expressions below once CMake 3.19 or higher is the minimum supported version.
+    set(should_build_all)
+    get_target_property(target_excluded_from_all ${target} EXCLUDE_FROM_ALL)
+    if (NOT target_excluded_from_all)
+      set(should_build_all ALL)
+    endif()
+    add_custom_target(${target_name} ${should_build_all} DEPENDS ${target} ${output_path})
     set_target_properties(${target_name} PROPERTIES FOLDER Tools)
 
     # Make sure both the link and target are toolchain tools


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132883.456636.patch
Type: text/x-patch
Size: 1001 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220830/db13879d/attachment.bin>


More information about the llvm-commits mailing list