From 37ce8d6ade24b2fb9f332b5ff94c25b40f1fc701 Mon Sep 17 00:00:00 2001 From: Stephen Neuendorffer Date: Sat, 16 May 2020 23:01:52 -0700 Subject: [PATCH] [MLIR] Fix linkage for libMLIR.so Generally: 1) don't use target_link_libraries() and add_mlir_library() on the same target, use LINK_LIBS PUBLIC instead. 2) don't use LINK_LIBS to specify LLVM libraries. Use LINK_COMPONENTS instead 3) no need to link against LLVMSupport. We pull it in by default. Differential Revision: https://reviews.llvm.org/D80076 --- mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt | 5 +++-- mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt | 2 -- mlir/lib/ExecutionEngine/CMakeLists.txt | 1 - mlir/lib/IR/CMakeLists.txt | 1 - mlir/lib/Support/CMakeLists.txt | 6 ------ 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt b/mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt index 82a36449323f..8cfb315bc6a1 100644 --- a/mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt +++ b/mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt @@ -7,6 +7,9 @@ add_mlir_conversion_library(MLIRLinalgToStandard DEPENDS MLIRConversionPassIncGen + LINK_COMPONENTS + Core + LINK_LIBS PUBLIC MLIREDSC MLIRIR @@ -14,6 +17,4 @@ add_mlir_conversion_library(MLIRLinalgToStandard MLIRPass MLIRSCF MLIRTransforms - LLVMCore - LLVMSupport ) diff --git a/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt b/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt index 43eb3210c3b2..0e2ef2dcc36c 100644 --- a/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt @@ -12,7 +12,5 @@ add_mlir_dialect_library(MLIRStandardOpsTransforms MLIRIR MLIRPass MLIRStandardOps - MLIRSupport MLIRTransforms - LLVMSupport ) diff --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt index ca62502e8c85..16258ed18b68 100644 --- a/mlir/lib/ExecutionEngine/CMakeLists.txt +++ b/mlir/lib/ExecutionEngine/CMakeLists.txt @@ -55,7 +55,6 @@ add_mlir_library(MLIRJitRunner Core OrcJIT JITLink - Support LINK_LIBS PUBLIC MLIRExecutionEngine diff --git a/mlir/lib/IR/CMakeLists.txt b/mlir/lib/IR/CMakeLists.txt index 8bf61c0a3ec3..5a238a6d058c 100644 --- a/mlir/lib/IR/CMakeLists.txt +++ b/mlir/lib/IR/CMakeLists.txt @@ -36,5 +36,4 @@ add_mlir_library(MLIRIR LINK_LIBS PUBLIC MLIRSupport - LLVMSupport ) diff --git a/mlir/lib/Support/CMakeLists.txt b/mlir/lib/Support/CMakeLists.txt index 2e380c0726be..bdba99057172 100644 --- a/mlir/lib/Support/CMakeLists.txt +++ b/mlir/lib/Support/CMakeLists.txt @@ -13,9 +13,6 @@ add_mlir_library(MLIRSupport ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Support - LINK_COMPONENTS - Support - LINK_LIBS PUBLIC ${LLVM_PTHREAD_LIB}) @@ -25,9 +22,6 @@ add_mlir_library(MLIROptLib ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Support - LINK_COMPONENTS - Support - LINK_LIBS PUBLIC MLIRPass MLIRParser