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

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 15:24:44 PDT 2019


smeenai added a comment.

Thanks for working on this!



================
Comment at: llvm/cmake/modules/TableGen.cmake:125
     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)
----------------
Thank you for fixing this.


================
Comment at: llvm/cmake/modules/TableGen.cmake:142
+      if ( NOT LLVM_BUILD_UTILS )
+        set(EXCLUDE_FROM_ALL ON)
+      endif()
----------------
I'm not a fan of this, especially since `add_tablegen` is a macro, so setting this variable will leak out of it.

Unfortunately, it doesn't seem like there's any other way to pass this information to `add_llvm_executable`. Ideally, you'd add a new argument to that method and use it here. Failing that, you should save the old value of `EXCLUDE_FROM_ALL` and restore it after your `add_llvm_executable` call, similar to what's being done for LLVM_LINK_COMPONENTS.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64032





More information about the llvm-commits mailing list