[Mlir-commits] [mlir] fac6be6 - [mlir] Prepend include directories before LLVM includes (#121223)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jan 1 07:31:53 PST 2025
Author: Michał Górny
Date: 2025-01-01T15:31:49Z
New Revision: fac6be61c6ccbae15647f4f2485415f630341e2a
URL: https://github.com/llvm/llvm-project/commit/fac6be61c6ccbae15647f4f2485415f630341e2a
DIFF: https://github.com/llvm/llvm-project/commit/fac6be61c6ccbae15647f4f2485415f630341e2a.diff
LOG: [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.
Added:
Modified:
mlir/CMakeLists.txt
Removed:
################################################################################
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
More information about the Mlir-commits
mailing list