summaryrefslogtreecommitdiff
path: root/mlir/CMakeLists.txt
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2025-01-01 15:31:49 +0000
committerGitHub <noreply@github.com>2025-01-01 15:31:49 +0000
commitfac6be61c6ccbae15647f4f2485415f630341e2a (patch)
tree39b321faf868f843d8a2e332b7288d00a0645b4c /mlir/CMakeLists.txt
parented572f2003275da8e06a634b4d6658b7921e8334 (diff)
[mlir] Prepend include directories before LLVM includes (#121223)
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.
Diffstat (limited to 'mlir/CMakeLists.txt')
-rw-r--r--mlir/CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 5ea49c0dbfa7..7416e522083b 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