[cfe-commits] r126502 - in /cfe/trunk: CMakeLists.txt tools/driver/CMakeLists.txt tools/libclang/CMakeLists.txt
Douglas Gregor
dgregor at apple.com
Fri Feb 25 11:24:02 PST 2011
Author: dgregor
Date: Fri Feb 25 13:24:02 2011
New Revision: 126502
URL: http://llvm.org/viewvc/llvm-project?rev=126502&view=rev
Log:
CMake: add version information into the clang executable and libclang
shared library.
Modified:
cfe/trunk/CMakeLists.txt
cfe/trunk/tools/driver/CMakeLists.txt
cfe/trunk/tools/libclang/CMakeLists.txt
Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=126502&r1=126501&r2=126502&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Fri Feb 25 13:24:02 2011
@@ -234,6 +234,16 @@
add_definitions( -D_GNU_SOURCE -DHAVE_CLANG_CONFIG_H )
+# Clang version information
+set(CLANG_EXECUTABLE_VERSION
+ "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}" CACHE STRING
+ "Version number that will be placed into the clang executable, in the form XX.YY")
+set(LIBCLANG_LIBRARY_VERSION
+ "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}" CACHE STRING
+ "Version number that will be placed into the libclang library , in the form XX.YY")
+mark_as_advanced(CLANG_EXECUTABLE_VERSION LIBCLANG_LIBRARY_VERSION)
+
+
option(CLANG_BUILD_EXAMPLES "Build CLANG example programs." OFF)
if(CLANG_BUILD_EXAMPLES)
add_subdirectory(examples)
Modified: cfe/trunk/tools/driver/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/CMakeLists.txt?rev=126502&r1=126501&r2=126502&view=diff
==============================================================================
--- cfe/trunk/tools/driver/CMakeLists.txt (original)
+++ cfe/trunk/tools/driver/CMakeLists.txt Fri Feb 25 13:24:02 2011
@@ -33,6 +33,8 @@
cc1as_main.cpp
)
+set_target_properties(clang PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION})
+
if(UNIX)
set(CLANGXX_LINK_OR_COPY create_symlink)
else()
@@ -47,6 +49,7 @@
"${clang_pp}"
DEPENDS clang)
set_target_properties(clang++ PROPERTIES FOLDER "Clang executables")
+
set_property(DIRECTORY APPEND
PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${clang_pp})
Modified: cfe/trunk/tools/libclang/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CMakeLists.txt?rev=126502&r1=126501&r2=126502&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CMakeLists.txt (original)
+++ cfe/trunk/tools/libclang/CMakeLists.txt Fri Feb 25 13:24:02 2011
@@ -30,15 +30,10 @@
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- # 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")
+ # Darwin-specific linker flags
+ set(LIBCLANG_LINK_FLAGS "-Wl,-compatibility_version -Wl,1")
+
set(LIBCLANG_LINK_FLAGS
"${LIBCLANG_LINK_FLAGS} -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000")
@@ -48,6 +43,9 @@
INSTALL_NAME_DIR "@executable_path/../lib")
endif()
+# Versioning information
+set_target_properties(libclang PROPERTIES VERSION ${LIBCLANG_LIBRARY_VERSION})
+
if(MSVC)
# windows.h doesn't compile with /Za
get_target_property(NON_ANSI_COMPILE_FLAGS libclang COMPILE_FLAGS)
More information about the cfe-commits
mailing list