summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-02 20:52:32 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-02 20:52:32 +0000
commitb1cf1ca19a648989099c2f013b1a7bb4c41117d2 (patch)
treef477fe54f7d87e43819b09d41e374c3c39b5e7aa
parentd9a30af25b22ddb336644cac36a653a706ccc5dc (diff)
downloadbcm5719-llvm-b1cf1ca19a648989099c2f013b1a7bb4c41117d2.tar.gz
bcm5719-llvm-b1cf1ca19a648989099c2f013b1a7bb4c41117d2.zip
Add Darwin dylib versioning support to libclang when build with CMake.
llvm-svn: 110062
-rw-r--r--clang/tools/libclang/CMakeLists.txt21
1 files changed, 13 insertions, 8 deletions
diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt
index ab4accae5e2..674946a36b1 100644
--- a/clang/tools/libclang/CMakeLists.txt
+++ b/clang/tools/libclang/CMakeLists.txt
@@ -31,17 +31,22 @@ add_clang_library(libclang
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- # FIXME: Deal with LLVM_SUBMIT_VERSION?
+ # dylib versioning information
+ # FIXME: Is there a more CMake-ish way to handle this?
+ set(LIBCLANG_VERSION 1
+ CACHE STRING "Version number of the libclang library")
+ set(LIBCLANG_SUBVERSION 0
+ CACHE STRING "Minor version number of the libclang library")
+ set(LIBCLANG_LINK_FLAGS
+ "-Wl,-current_version -Wl,${LIBCLANG_VERSION}.${LIBCLANG_SUBVERSION} -Wl,-compatibility_version -Wl,1")
+
+ set(LIBCLANG_LINK_FLAGS
+ "${LIBCLANG_LINK_FLAGS} -avoid-version -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000")
- # FIXME: This uses a special darwin-specific exports file in order to
- # get underscore-prefixed names. It would be better to have build rules
- # which know how to produce a darwin-suitable exports file from the
- # regular exports file.
set_target_properties(libclang
PROPERTIES
- LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/libclang.darwin.exports -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000"
- INSTALL_NAME_DIR "@executable_path/../lib"
- )
+ LINK_FLAGS "${LIBCLANG_LINK_FLAGS}"
+ INSTALL_NAME_DIR "@executable_path/../lib")
endif()
if(MSVC)
OpenPOWER on IntegriCloud