[PATCH] D80103: [cmake][NFC] Check for incorrect usage of LLVM components in LINK_LIBS
Stephen Neuendorffer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 18 15:12:23 PDT 2020
stephenneuendorffer edited the summary of this revision.
stephenneuendorffer updated this revision to Diff 264727.
Herald added subscribers: jurahul, Kayjukh, frgossen, grosul1, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, jpienaar, rriddle.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80103/new/
https://reviews.llvm.org/D80103
Files:
mlir/cmake/modules/AddMLIR.cmake
Index: mlir/cmake/modules/AddMLIR.cmake
===================================================================
--- mlir/cmake/modules/AddMLIR.cmake
+++ mlir/cmake/modules/AddMLIR.cmake
@@ -108,6 +108,16 @@
# MLIR libraries uniformly depend on LLVMSupport. Just specify it once here.
list(APPEND ARG_LINK_COMPONENTS Support)
+
+ # LINK_COMPONENTS is necessary to allow libLLVM.so to be properly
+ # substituted for individual library dependencies if LLVM_LINK_LLVM_DYLIB
+ get_property(llvm_component_libs GLOBAL PROPERTY LLVM_COMPONENT_LIBS)
+ foreach(lib ${ARG_LINK_LIBS})
+ if(${lib} IN_LIST llvm_component_libs)
+ message(SEND_ERROR "${name} specifies LINK_LIBS ${lib}, but LINK_LIBS cannot be used for LLVM libraries. Please use LINK_COMPONENTS instead.")
+ endif()
+ endforeach()
+
list(APPEND ARG_DEPENDS mlir-generic-headers)
llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs} DEPENDS ${ARG_DEPENDS} LINK_COMPONENTS ${ARG_LINK_COMPONENTS} LINK_LIBS ${ARG_LINK_LIBS})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80103.264727.patch
Type: text/x-patch
Size: 1024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200518/07d23ce8/attachment.bin>
More information about the llvm-commits
mailing list