CMakeLists.txt: Fix bad include paths in torch_mlir_target_includes #3897
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The removed code was generating include paths like
-Itorch-mlir/lib/Dialect/TorchConversion/IR/ci/llvm-project/mlir/include
in in-tree builds where the intention was to generate-Itorch-mlir/lib/Dialect/TorchConversion/IR -I/ci/llvm-project/mlir/include
when running a build in a top level directory like/ci
.I think this is due to
MLIR_INCLUDE_DIRS
containing two directories, and it seems that together with$<BUILD_INTERFACE:
, it triggers a bug (?) in cmake where it concatenates the previous and this new path instead of separating them.We actually don't need to add
MLIR_INCLUDE_DIRS
here anyways because we already doinclude_directories(${MLIR_INCLUDE_DIRS})
above. So this PR just removes it.The issue can best be see in the
compile_commands.json
on a target likeInitAll.cpp
.