diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-08-17 22:10:34 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-08-17 22:10:34 +0200 |
commit | c7c00f22fa96aaaed4ef025e8381b44642306281 (patch) | |
tree | 854793394d51dc556162c5d44f8662e9eaa2e4cd /community/llvm3.7/cmake-fix-libLLVM-name.patch | |
parent | 28eea326ce6605ee708cb1df0c67a3f90cdb5a79 (diff) | |
download | aports-c7c00f22fa96aaaed4ef025e8381b44642306281.tar.bz2 aports-c7c00f22fa96aaaed4ef025e8381b44642306281.tar.xz |
community/llvm3.7: move from testing
Diffstat (limited to 'community/llvm3.7/cmake-fix-libLLVM-name.patch')
-rw-r--r-- | community/llvm3.7/cmake-fix-libLLVM-name.patch | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/community/llvm3.7/cmake-fix-libLLVM-name.patch b/community/llvm3.7/cmake-fix-libLLVM-name.patch new file mode 100644 index 0000000000..600e32777f --- /dev/null +++ b/community/llvm3.7/cmake-fix-libLLVM-name.patch @@ -0,0 +1,76 @@ +From: Jakub Jirutka <jakub@jirutka.cz> +Date: Sun, 07 Aug 2016 12:37:00 +0200 +Subject: [PATCH] Include version in name of shared libs + +This change makes the CMake build system generate libraries for Linux and +Darwin matching the makefile build system. + +libLLVM.so -> libLLVM-$MAJOR.$MINOR.so +libLTO.so -> libLTO-$MAJOR.$MINOR.so + +See https://github.com/llvm-mirror/llvm/commit/61dbca10ea813ea3af447cc7ac2556a5e81211f9 + +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -313,10 +313,12 @@ + # Same semantics as target_link_libraries(). + # ADDITIONAL_HEADERS + # May specify header files for IDE generators. ++# SONAME ++# Should set SONAME link flags and create symlinks + # ) + function(llvm_add_library name) + cmake_parse_arguments(ARG +- "MODULE;SHARED;STATIC" ++ "MODULE;SHARED;STATIC;SONAME" + "OUTPUT_NAME" + "ADDITIONAL_HEADERS;DEPENDS;LINK_COMPONENTS;LINK_LIBS;OBJLIBS" + ${ARGN}) +@@ -418,11 +420,6 @@ + PREFIX "" + ) + endif() +- +- set_target_properties(${name} +- PROPERTIES +- SOVERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR} +- VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}) + endif() + + if(ARG_MODULE OR ARG_SHARED) +@@ -483,7 +480,7 @@ + + macro(add_llvm_library name) + cmake_parse_arguments(ARG +- "SHARED" ++ "SHARED;SONAME" + "" + "" + ${ARGN}) +@@ -526,6 +523,15 @@ + -DCMAKE_INSTALL_COMPONENT=${name} + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") + endif() ++ if(ARG_SHARED) ++ get_target_property(output_name ${name} OUTPUT_NAME) ++ if(${output_name} STREQUAL "output_name-NOTFOUND") ++ set(output_name ${name}) ++ endif() ++ set(library_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX}) ++ set(api_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}) ++ set_target_properties(${name} PROPERTIES OUTPUT_NAME ${library_name}) ++ endif() + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endif() +--- a/tools/llvm-shlib/CMakeLists.txt ++++ b/tools/llvm-shlib/CMakeLists.txt +@@ -95,7 +95,7 @@ + add_custom_target(libLLVMExports DEPENDS ${LLVM_EXPORTED_SYMBOL_FILE}) + endif() + +-add_llvm_library(LLVM SHARED ${SOURCES}) ++add_llvm_library(LLVM SHARED SONAME ${SOURCES}) + + list(REMOVE_DUPLICATES LIB_NAMES) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") # FIXME: It should be "GNU ld for elf" |