[PATCH] [lld] Boot bitrotting add_lld_library() from CMake build
Greg Fitzgerald
garious at gmail.com
Tue Jan 20 14:02:17 PST 2015
Hi rafael, chandlerc, Bigcheese,
add_llvm_library calls llvm_add_library, which works better for shared libraries (sets PRIVATE instead of INTERFACE) and coincidently fixes http://llvm.org/bugs/show_bug.cgi?id=22269 as well.
REPOSITORY
rL LLVM
http://reviews.llvm.org/D7074
Files:
CMakeLists.txt
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -106,36 +106,7 @@
endif()
macro(add_lld_library name)
- llvm_process_sources(srcs ${ARGN})
- if (MSVC_IDE OR XCODE)
- string(REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR})
- list(GET split_path -1 dir)
- file(GLOB_RECURSE headers
- ../../include/lld${dir}/*.h)
- set(srcs ${srcs} ${headers})
- endif()
- if (MODULE)
- set(libkind MODULE)
- elseif (SHARED_LIBRARY)
- set(libkind SHARED)
- else()
- set(libkind)
- endif()
- add_library(${name} ${libkind} ${srcs})
- llvm_update_compile_flags(${name} ${srcs})
- if (LLVM_COMMON_DEPENDS)
- add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
- endif()
-
- target_link_libraries(${name} ${LLVM_USED_LIBS})
- llvm_config(${name} ${LLVM_LINK_COMPONENTS})
- target_link_libraries(${name} ${LLVM_COMMON_LIBS})
-
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
- install(TARGETS ${name}
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
- endif()
+ add_llvm_library(${name} ${ARGN})
set_target_properties(${name} PROPERTIES FOLDER "lld libraries")
endmacro(add_lld_library)
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7074.18459.patch
Type: text/x-patch
Size: 1264 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150120/812d04e3/attachment.bin>
More information about the llvm-commits
mailing list