[PATCH] D16158: [CMake] Add clang's targets to LLVM's export set when not building standalone
Chris Bieneman via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 13 14:57:25 PST 2016
beanz created this revision.
beanz added reviewers: rnk, chapuni, hintonda.
beanz added a subscriber: cfe-commits.
CMake freaks out in trivial cases like:
> cmake -G Ninja -DLLVM_ENABLE_PIC=Off -DLLVM_INSTALL_TOOLCHAIN_ONLY=On ../llvm
This is a result of static ink dependencies not all being part of the same export group, and was caused by r249935.
http://reviews.llvm.org/D16158
Files:
CMakeLists.txt
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -177,8 +177,10 @@
set( CLANG_BUILT_STANDALONE 1 )
set(BACKEND_PACKAGE_STRING "LLVM ${LLVM_PACKAGE_VERSION}")
+ set(EXPORT_GROUP ClangTargets)
else()
set(BACKEND_PACKAGE_STRING "${PACKAGE_STRING}")
+ set(EXPORT_GROUP LLVMExports)
endif()
find_package(LibXml2 2.5.3 QUIET)
@@ -401,7 +403,7 @@
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
install(TARGETS ${name}
COMPONENT ${name}
- EXPORT ClangTargets
+ EXPORT ${EXPORT_GROUP}
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
RUNTIME DESTINATION bin)
@@ -582,8 +584,7 @@
set(CLANG_ORDER_FILE "" CACHE FILEPATH
"Order file to use when compiling clang in order to improve startup time.")
-if (CLANG_BUILT_STANDALONE OR CMAKE_VERSION VERSION_EQUAL 3 OR
- CMAKE_VERSION VERSION_GREATER 3)
+if (CLANG_BUILT_STANDALONE)
# Generate a list of CMake library targets so that other CMake projects can
# link against them. LLVM calls its version of this file LLVMExports.cmake, but
# the usual CMake convention seems to be ${Project}Targets.cmake.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16158.44798.patch
Type: text/x-patch
Size: 1277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160113/f5b56175/attachment.bin>
More information about the cfe-commits
mailing list