OSDN Git Service

[MLIR] Fix linkage for libMLIR.so
authorStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Sun, 17 May 2020 06:01:52 +0000 (23:01 -0700)
committerStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Sun, 17 May 2020 20:46:52 +0000 (13:46 -0700)
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
mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt
mlir/lib/ExecutionEngine/CMakeLists.txt
mlir/lib/IR/CMakeLists.txt
mlir/lib/Support/CMakeLists.txt

index 82a3644..8cfb315 100644 (file)
@@ -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
   )
index 43eb321..0e2ef2d 100644 (file)
@@ -12,7 +12,5 @@ add_mlir_dialect_library(MLIRStandardOpsTransforms
   MLIRIR
   MLIRPass
   MLIRStandardOps
-  MLIRSupport
   MLIRTransforms
-  LLVMSupport
   )
index ca62502..16258ed 100644 (file)
@@ -55,7 +55,6 @@ add_mlir_library(MLIRJitRunner
   Core
   OrcJIT
   JITLink
-  Support
 
   LINK_LIBS PUBLIC
   MLIRExecutionEngine
index 8bf61c0..5a238a6 100644 (file)
@@ -36,5 +36,4 @@ add_mlir_library(MLIRIR
 
   LINK_LIBS PUBLIC
   MLIRSupport
-  LLVMSupport
   )
index 2e380c0..bdba990 100644 (file)
@@ -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