[PATCH] D64032: [cmake] With utils disabled, don't build tblgen in cross mode

Keno Fischer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 15:45:33 PDT 2019


loladiro updated this revision to Diff 207424.
loladiro added a comment.

Use set_target_properties to set EXCLUDE_FROM_ALL on the target rather than using
the global setting.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64032

Files:
  llvm/cmake/modules/TableGen.cmake


Index: llvm/cmake/modules/TableGen.cmake
===================================================================
--- llvm/cmake/modules/TableGen.cmake
+++ llvm/cmake/modules/TableGen.cmake
@@ -125,7 +125,7 @@
 
   if(LLVM_USE_HOST_TOOLS)
     if( ${${project}_TABLEGEN} STREQUAL "${target}" )
-      build_native_tool(${target} ${project}_TABLEGEN_EXE DEPENDS ${target})
+      build_native_tool(${target} ${project}_TABLEGEN_EXE)
       set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE)
 
       add_custom_target(${project}-tablegen-host DEPENDS ${${project}_TABLEGEN_EXE})
@@ -138,6 +138,12 @@
           TARGET LLVM-tablegen-host)
         add_dependencies(${project}-tablegen-host LLVM-tablegen-host)
       endif()
+
+      # If we're using the host tablegen, and utils were not requested, we have no
+      # need to build this tablegen.
+      if ( NOT LLVM_BUILD_UTILS )
+        set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL ON)
+      endif()
     endif()
   endif()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64032.207424.patch
Type: text/x-patch
Size: 1009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190701/a74dec4e/attachment.bin>


More information about the llvm-commits mailing list