Skip to content

Commit fac6be6

Browse files
authored
[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.
1 parent ed572f2 commit fac6be6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mlir/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,10 @@ endif()
196196

197197
set(CMAKE_INCLUDE_CURRENT_DIR ON)
198198

199-
include_directories( "include")
200-
include_directories( ${MLIR_INCLUDE_DIR})
199+
include_directories(BEFORE
200+
"include"
201+
${MLIR_INCLUDE_DIR}
202+
)
201203

202204
# Adding tools/mlir-tblgen here as calling add_tablegen sets some variables like
203205
# MLIR_TABLEGEN_EXE in PARENT_SCOPE which gets lost if that folder is included

0 commit comments

Comments
 (0)