[Mlir-commits] [mlir] 37ce8d6 - [MLIR] Fix linkage for libMLIR.so

Stephen Neuendorffer llvmlistbot at llvm.org
Sun May 17 13:58:29 PDT 2020


Author: Stephen Neuendorffer
Date: 2020-05-17T13:46:52-07:00
New Revision: 37ce8d6ade24b2fb9f332b5ff94c25b40f1fc701

URL: https://github.com/llvm/llvm-project/commit/37ce8d6ade24b2fb9f332b5ff94c25b40f1fc701
DIFF: https://github.com/llvm/llvm-project/commit/37ce8d6ade24b2fb9f332b5ff94c25b40f1fc701.diff

LOG: [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

Added: 
    

Modified: 
    mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt
    mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt
    mlir/lib/ExecutionEngine/CMakeLists.txt
    mlir/lib/IR/CMakeLists.txt
    mlir/lib/Support/CMakeLists.txt

Removed: 
    


################################################################################
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


        


More information about the Mlir-commits mailing list