diff options
author | Jeff Niu <jeff@modular.com> | 2022-09-01 21:06:46 +0300 |
---|---|---|
committer | Jeff Niu <jeff@modular.com> | 2022-09-02 22:13:49 +0300 |
commit | 7691b69d5b2f5e9d8b210add22926335b3541444 (patch) | |
tree | fa77ce87ee5833699ab51cb985067618b10d8e62 /mlir/cmake | |
parent | bf7a74499c2026754d4b847dfa18dc7287651c60 (diff) |
[mlir][cmake] Don't add dependencies on mlir-(generic-)headers
Every dialect was dependent on `mlir-headers`, which was causing the
build of any single MLIR dialect to pull in a bunch of extra
dependencies that aren't needed. Now, MLIR dialects will need to
explicitly depend on `MLIR*IncGen` targets to pull in any needed
headers.
This does not impact the actual `mlir-header` target.
Consider the "simple" Arithmetic dialect. Before:
```
% ninja MLIRArithmeticDialect
[151/812] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/JSONBackend.cpp.o
```
After:
```
% ninja MLIRArithmeticDialect
[207/374] Building CXX object tools/mlir/lib/TableGen/CMakeFiles/MLIRTableGen.dir/GenInfo.cpp.o
```
(Both clean builds)
Reviewed By: rriddle, jpienaar
Differential Revision: https://reviews.llvm.org/D133132
Diffstat (limited to 'mlir/cmake')
-rw-r--r-- | mlir/cmake/modules/AddMLIR.cmake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mlir/cmake/modules/AddMLIR.cmake b/mlir/cmake/modules/AddMLIR.cmake index 15079eea3009..dbcc13aea781 100644 --- a/mlir/cmake/modules/AddMLIR.cmake +++ b/mlir/cmake/modules/AddMLIR.cmake @@ -577,19 +577,19 @@ endfunction() # Declare the library associated with a dialect. function(add_mlir_dialect_library name) set_property(GLOBAL APPEND PROPERTY MLIR_DIALECT_LIBS ${name}) - add_mlir_library(${ARGV} DEPENDS mlir-headers) + add_mlir_library(${ARGV}) endfunction(add_mlir_dialect_library) # Declare the library associated with a conversion. function(add_mlir_conversion_library name) set_property(GLOBAL APPEND PROPERTY MLIR_CONVERSION_LIBS ${name}) - add_mlir_library(${ARGV} DEPENDS mlir-headers) + add_mlir_library(${ARGV}) endfunction(add_mlir_conversion_library) # Declare the library associated with a translation. function(add_mlir_translation_library name) set_property(GLOBAL APPEND PROPERTY MLIR_TRANSLATION_LIBS ${name}) - add_mlir_library(${ARGV} DEPENDS mlir-headers) + add_mlir_library(${ARGV}) endfunction(add_mlir_translation_library) # Verification tools to aid debugging. |