[Mlir-commits] [mlir] [mlir] Prepend include directories before LLVM includes (PR #121223)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Dec 27 11:04:52 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Michał Górny (mgorny)
<details>
<summary>Changes</summary>
Prepend mlir's include directories before system LLVM include directories. This is particularly important for standalone builds, where system include directory may contain the previous version of mlir, and therefore various mlir targets (particularly tablegen) end up using the headers from the previous version over the fresh ones. The new logic is copied from clang.
---
Full diff: https://github.com/llvm/llvm-project/pull/121223.diff
1 Files Affected:
- (modified) mlir/CMakeLists.txt (+4-2)
``````````diff
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 5ea49c0dbfa7e3..7416e522083b7b 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -196,8 +196,10 @@ endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-include_directories( "include")
-include_directories( ${MLIR_INCLUDE_DIR})
+include_directories(BEFORE
+ "include"
+ ${MLIR_INCLUDE_DIR}
+ )
# Adding tools/mlir-tblgen here as calling add_tablegen sets some variables like
# MLIR_TABLEGEN_EXE in PARENT_SCOPE which gets lost if that folder is included
``````````
</details>
https://github.com/llvm/llvm-project/pull/121223
More information about the Mlir-commits
mailing list