Followup on D121562 as a step as part of:
https://discourse.llvm.org/t/rfc-restructuring-of-the-mlir-repo/4927
Details
- Reviewers
stellaraccident rriddle
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/CMakeLists.txt | ||
---|---|---|
27 | @stellaraccident : I'm trying to work around the issue that using a global property exposes us to the order of traversal in CMake. If the core/ directory is traversed before the dialects are visited, the MLIR_DIALECT_LIBS property is still empty. Ideally we'd use an "INTERFACE" library in cmake, but because it won't work with the install and export_set, I ended up adding an empty source file. Any better suggestion here? |
mlir/lib/CMakeLists.txt | ||
---|---|---|
27 | I'm going to need to stare at this for a few minutes to have a concrete suggestion. I can think of some obvious quick fixes but would like to see if there is a way to avoid the weird coupling. Have some meetings now but have a good chunk of time later today and will see if I can work this out. |
mlir/lib/CMakeLists.txt | ||
---|---|---|
27 | I think that INTERFACE libraries can be installed (we use them that way elsewhere), but I also recall there being weirdness that may make them not great options. In the absence of that, this kind of empty.cpp is sota. I think you need the contents to be something like: typedef int dummy; (In order to avoid empty translation unit warnings in all cases). See llvm/cmake/dummy.cpp. I'd like to take a look at the tree and propose a better place for these kinds of things that need access to everything. |
@stellaraccident : I'm trying to work around the issue that using a global property exposes us to the order of traversal in CMake.
If the core/ directory is traversed before the dialects are visited, the MLIR_DIALECT_LIBS property is still empty.
Instead I'm defining a library which cmake resolves after parsing completes (or something like that).
Ideally we'd use an "INTERFACE" library in cmake, but because it won't work with the install and export_set, I ended up adding an empty source file. Any better suggestion here?