[PATCH] D77156: [CMAKE] Plumb include_directories() into tablegen()

Stephen Neuendorffer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 31 11:58:57 PDT 2020


stephenneuendorffer created this revision.
Herald added subscribers: cfe-commits, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini, mgorny.
Herald added a project: clang.
stephenneuendorffer added reviewers: mehdi_amini, tstellar.

Previously, the tablegen() cmake command, which defines custom
commands for running tablegen, included several hardcoded paths.  This
becomes unwieldy as there are more users for which these paths are
insufficient.  For most targets, cmake uses include_directories() and
the INCLUDE_DIRECTORIES directory property to specify include paths.
This change picks up the INCLUDE_DIRECTORIES property and adds it
to the include path used when running tablegen.  As a side effect, this
allows us to remove several hard coded paths to tablegen that are redundant
with specified include_directories().

I haven't removed the hardcoded path to CMAKE_CURRENT_SOURCE_DIR, which
seems generically useful.  There are several users in clang which apparently
don't have the current directory as an include_directories().  This could
be considered separately.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77156

Files:
  clang/cmake/modules/AddClang.cmake
  llvm/cmake/modules/TableGen.cmake
  mlir/cmake/modules/AddMLIR.cmake
  mlir/examples/toy/Ch3/CMakeLists.txt
  mlir/examples/toy/Ch4/CMakeLists.txt
  mlir/examples/toy/Ch4/include/toy/CMakeLists.txt
  mlir/examples/toy/Ch5/CMakeLists.txt
  mlir/examples/toy/Ch5/include/toy/CMakeLists.txt
  mlir/examples/toy/Ch6/CMakeLists.txt
  mlir/examples/toy/Ch6/include/toy/CMakeLists.txt
  mlir/examples/toy/Ch7/CMakeLists.txt
  mlir/examples/toy/Ch7/include/toy/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77156.253945.patch
Type: text/x-patch
Size: 8750 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200331/9d3787b6/attachment-0001.bin>


More information about the cfe-commits mailing list