From 180fa9cd7ea3bb8ea3248b57c55d28555102edc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 27 Dec 2024 20:01:04 +0100 Subject: [PATCH] [mlir] Prepend include directories before LLVM includes 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. --- mlir/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt index 5ea49c0dbfa7e..7416e522083b7 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