[Mlir-commits] [mlir] 6593cd3 - [mlir] Replace `include_directories`
Marius Brehler
llvmlistbot at llvm.org
Fri Sep 10 00:06:46 PDT 2021
Author: Marius Brehler
Date: 2021-09-10T07:06:27Z
New Revision: 6593cd3fe989213aefe0c76092d053206917b54f
URL: https://github.com/llvm/llvm-project/commit/6593cd3fe989213aefe0c76092d053206917b54f
DIFF: https://github.com/llvm/llvm-project/commit/6593cd3fe989213aefe0c76092d053206917b54f.diff
LOG: [mlir] Replace `include_directories`
Switches to adding target specific, private includes instead of adding
global includes.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D109494
Added:
Modified:
mlir/test/lib/Analysis/CMakeLists.txt
mlir/test/lib/Conversion/StandardToLLVM/CMakeLists.txt
mlir/test/lib/Dialect/DLTI/CMakeLists.txt
mlir/test/lib/Dialect/StandardOps/CMakeLists.txt
mlir/test/lib/IR/CMakeLists.txt
mlir/test/lib/Transforms/CMakeLists.txt
mlir/unittests/TableGen/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/test/lib/Analysis/CMakeLists.txt b/mlir/test/lib/Analysis/CMakeLists.txt
index 07f5bde4e2db..013d4f3225a4 100644
--- a/mlir/test/lib/Analysis/CMakeLists.txt
+++ b/mlir/test/lib/Analysis/CMakeLists.txt
@@ -19,5 +19,8 @@ add_mlir_library(MLIRTestAnalysis
MLIRTestDialect
)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test)
-include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test)
+target_include_directories(MLIRTestAnalysis
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test
+ ${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
+ )
diff --git a/mlir/test/lib/Conversion/StandardToLLVM/CMakeLists.txt b/mlir/test/lib/Conversion/StandardToLLVM/CMakeLists.txt
index 576775ed43b8..5d50d479b555 100644
--- a/mlir/test/lib/Conversion/StandardToLLVM/CMakeLists.txt
+++ b/mlir/test/lib/Conversion/StandardToLLVM/CMakeLists.txt
@@ -13,5 +13,8 @@ add_mlir_library(MLIRTestStandardToLLVM
MLIRTestDialect
)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../Dialect/Test)
-include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../Dialect/Test)
+target_include_directories(MLIRTestStandardToLLVM
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../Dialect/Test
+ ${CMAKE_CURRENT_BINARY_DIR}/../../Dialect/Test
+ )
diff --git a/mlir/test/lib/Dialect/DLTI/CMakeLists.txt b/mlir/test/lib/Dialect/DLTI/CMakeLists.txt
index f9a17f42ab4e..cc81817b67d6 100644
--- a/mlir/test/lib/Dialect/DLTI/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/DLTI/CMakeLists.txt
@@ -10,5 +10,8 @@ add_mlir_library(MLIRDLTITestPasses
MLIRTestDialect
)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Test)
-include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Test)
+target_include_directories(MLIRDLTITestPasses
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Test
+ ${CMAKE_CURRENT_BINARY_DIR}/../Test
+ )
diff --git a/mlir/test/lib/Dialect/StandardOps/CMakeLists.txt b/mlir/test/lib/Dialect/StandardOps/CMakeLists.txt
index 4d4cd107f211..22d5818e3413 100644
--- a/mlir/test/lib/Dialect/StandardOps/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/StandardOps/CMakeLists.txt
@@ -13,5 +13,8 @@ add_mlir_library(MLIRStandardOpsTestPasses
MLIRTransformUtils
)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Test)
-include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Test)
+target_include_directories(MLIRStandardOpsTestPasses
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Test
+ ${CMAKE_CURRENT_BINARY_DIR}/../Test
+ )
diff --git a/mlir/test/lib/IR/CMakeLists.txt b/mlir/test/lib/IR/CMakeLists.txt
index 07d6e4f505c7..8fc9a22e6c74 100644
--- a/mlir/test/lib/IR/CMakeLists.txt
+++ b/mlir/test/lib/IR/CMakeLists.txt
@@ -21,5 +21,9 @@ add_mlir_library(MLIRTestIR
MLIRPass
MLIRTestDialect
)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test)
-include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test)
+
+target_include_directories(MLIRTestIR
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test
+ ${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
+ )
diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt
index 922988dbf0e1..8d5dc53ad8d1 100644
--- a/mlir/test/lib/Transforms/CMakeLists.txt
+++ b/mlir/test/lib/Transforms/CMakeLists.txt
@@ -17,5 +17,8 @@ add_mlir_library(MLIRTestTransforms
MLIRTransforms
)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test)
-include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test)
+target_include_directories(MLIRTestTransforms
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test
+ ${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
+ )
diff --git a/mlir/unittests/TableGen/CMakeLists.txt b/mlir/unittests/TableGen/CMakeLists.txt
index 421133be473f..5e365f7c49f8 100644
--- a/mlir/unittests/TableGen/CMakeLists.txt
+++ b/mlir/unittests/TableGen/CMakeLists.txt
@@ -25,8 +25,11 @@ add_dependencies(MLIRTableGenTests MLIRTableGenStructAttrIncGen)
add_dependencies(MLIRTableGenTests MLIRTableGenTestPassIncGen)
add_dependencies(MLIRTableGenTests MLIRTestDialect)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../test/lib/Dialect/Test)
-include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../test/lib/Dialect/Test)
+target_include_directories(MLIRTableGenTests
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../test/lib/Dialect/Test
+ ${CMAKE_CURRENT_BINARY_DIR}/../../test/lib/Dialect/Test
+)
target_link_libraries(MLIRTableGenTests
PRIVATE MLIRTableGen MLIRIR
More information about the Mlir-commits
mailing list