Skip to content

Commit

Permalink
[mlir] Prepend include directories before LLVM includes (llvm#121223)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mgorny authored Jan 1, 2025
1 parent ed572f2 commit fac6be6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fac6be6

Please sign in to comment.