[PATCH] D72587: [MLIR] Mark application libraries as "BUILDTREE_ONLY"

Stephen Neuendorffer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 00:08:40 PST 2020


stephenneuendorffer created this revision.
Herald added subscribers: llvm-commits, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini, mgorny.
Herald added a project: LLVM.

These libraries are intended to be used as part of specific
applications (like mlir-opt).  If they are both included in a single
library (e.g. libLLVM.so), then their options will collide, because
static initializers will be called more than once.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72587

Files:
  mlir/lib/Support/CMakeLists.txt
  mlir/tools/mlir-opt/CMakeLists.txt


Index: mlir/tools/mlir-opt/CMakeLists.txt
===================================================================
--- mlir/tools/mlir-opt/CMakeLists.txt
+++ mlir/tools/mlir-opt/CMakeLists.txt
@@ -10,7 +10,7 @@
   MLIRTransforms
   MLIRSupport
 )
-add_llvm_library(MLIRMlirOptLib
+add_llvm_library(MLIRMlirOptLib BUILDTREE_ONLY
   mlir-opt.cpp
 )
 target_link_libraries(MLIRMlirOptLib ${LIB_LIBS})
@@ -65,4 +65,4 @@
 )
 llvm_update_compile_flags(mlir-opt)
 whole_archive_link(mlir-opt ${LIBS})
-target_link_libraries(mlir-opt PRIVATE MLIRIR MLIRMlirOptLib ${LIBS} LLVMSupport)
+target_link_libraries(mlir-opt PRIVATE MLIRIR MLIROptMain MLIRMlirOptLib ${LIBS} LLVMSupport)
Index: mlir/lib/Support/CMakeLists.txt
===================================================================
--- mlir/lib/Support/CMakeLists.txt
+++ mlir/lib/Support/CMakeLists.txt
@@ -17,7 +17,7 @@
   )
 target_link_libraries(MLIRSupport LLVMSupport ${LLVM_PTHREAD_LIB})
 
-add_llvm_library(MLIROptMain
+add_llvm_library(MLIROptMain BUILDTREE_ONLY
   MlirOptMain.cpp
 
   ADDITIONAL_HEADER_DIRS
@@ -37,7 +37,7 @@
   )
 target_link_libraries(MLIRTranslateClParser LLVMSupport)
 
-add_llvm_library(MLIRJitRunner
+add_llvm_library(MLIRJitRunner BUILDTREE_ONLY
   JitRunner.cpp
 )
 target_link_libraries(MLIRJitRunner PRIVATE


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72587.237585.patch
Type: text/x-patch
Size: 1288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200113/9078972e/attachment.bin>


More information about the llvm-commits mailing list