[PATCH] D131052: [CMake] Allow setting the location of host tools with LLVM_NATIVE_TOOL_DIR

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 06:34:00 PST 2023


mstorsjo updated this revision to Diff 488982.
mstorsjo added a comment.
Herald added subscribers: Moerafaat, zero9178, bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, stephenneuendorffer, liufengdb, aartbik, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, rriddle, mehdi_amini.
Herald added a reviewer: njames93.
Herald added a project: MLIR.

Factorized setup of building a separate host version of code generation tools into a macro, shared across existing users.

There are some minor nuance differences to how tool generation happened before, but it should probably not matter (and this is probably an improvement):

- Only look at the user setting variable (for pointing to a preexisting external tool executable) if LLVM_USE_HOST_TOOLS is set; if LLVM_USE_HOST_TOOLS isn't set, ignore the variable. (mlir-linalg-ods-gen already did it this way, the clang-tools-extra tools didn't.)
- Add a dependency on the target version of the executable, when building a native one - this makes sure to regenereate the native one when there are changes to the sources for that tool (according to other cmake comments in the code; the clang-tools-extra tools didn't do this before).

If wanted, I could split this up into two patches; one for refactoring the call sites and one for adding the new variable LLVM_NATIVE_TOOL_DIR - but I'm posting them as one single patch here for now, to hopefully get it reviewed quicker.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131052

Files:
  clang-tools-extra/clang-tidy/misc/CMakeLists.txt
  clang-tools-extra/pseudo/include/CMakeLists.txt
  llvm/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/cmake/modules/TableGen.cmake
  llvm/tools/llvm-config/CMakeLists.txt
  mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131052.488982.patch
Type: text/x-patch
Size: 8188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230113/b5b20a09/attachment.bin>


More information about the llvm-commits mailing list