Title: [160994] trunk
Revision
160994
Author
mrobin...@webkit.org
Date
2013-12-23 06:45:44 -0800 (Mon, 23 Dec 2013)

Log Message

.: https://bugs.webkit.org/show_bug.cgi?id=125511

[GTK][CMake] libtool-compatible soversion calculation
Reviewed by Gustavo Noronha Silva.

* Source/cmake/OptionsGTK.cmake: Specify the appropriate libtool triples and use
the CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE macro to specify the library-specific
version information.
* Source/cmake/WebKitHelpers.cmake: Add some helpful macros.

Source/_javascript_Core: [GTK][CMake] libtool-compatible soversion calculation
https://bugs.webkit.org/show_bug.cgi?id=125511

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Use the POPULATE_LIBRARY_VERSION macro and the
library-specific version information.

Source/WebKit: [GTK][CMake] libtool-compatible soversion calculation
https://bugs.webkit.org/show_bug.cgi?id=125511

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Use the POPULATE_LIBRARY_VERSION macro and the
library-specific version information.

Source/WebKit2: [GTK][CMake] libtool-compatible soversion calculation
https://bugs.webkit.org/show_bug.cgi?id=125511

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Use the POPULATE_LIBRARY_VERSION macro and the
library-specific version information.

Modified Paths

Diff

Modified: trunk/ChangeLog (160993 => 160994)


--- trunk/ChangeLog	2013-12-23 13:35:00 UTC (rev 160993)
+++ trunk/ChangeLog	2013-12-23 14:45:44 UTC (rev 160994)
@@ -1,3 +1,15 @@
+2013-12-22  Martin Robinson  <mrobin...@igalia.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=125511
+
+        [GTK][CMake] libtool-compatible soversion calculation
+        Reviewed by Gustavo Noronha Silva.
+
+        * Source/cmake/OptionsGTK.cmake: Specify the appropriate libtool triples and use
+        the CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE macro to specify the library-specific
+        version information.
+        * Source/cmake/WebKitHelpers.cmake: Add some helpful macros.
+
 2013-12-23  Gustavo Noronha Silva  <g...@gnome.org>
 
         [GTK] [CMake] Generate pkg-config files

Modified: trunk/Source/_javascript_Core/CMakeLists.txt (160993 => 160994)


--- trunk/Source/_javascript_Core/CMakeLists.txt	2013-12-23 13:35:00 UTC (rev 160993)
+++ trunk/Source/_javascript_Core/CMakeLists.txt	2013-12-23 14:45:44 UTC (rev 160994)
@@ -762,6 +762,7 @@
 endif ()
 
 if (${_javascript_Core_LIBRARY_TYPE} STREQUAL "SHARED_LIBRARY")
-    set_target_properties(_javascript_Core PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
+    POPULATE_LIBRARY_VERSION(_javascript_CORE)
+    set_target_properties(_javascript_Core PROPERTIES VERSION ${_javascript_CORE_VERSION} SOVERSION ${_javascript_CORE_VERSION_MAJOR})
     install(TARGETS _javascript_Core DESTINATION "${LIB_INSTALL_DIR}")
 endif ()

Modified: trunk/Source/_javascript_Core/ChangeLog (160993 => 160994)


--- trunk/Source/_javascript_Core/ChangeLog	2013-12-23 13:35:00 UTC (rev 160993)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-12-23 14:45:44 UTC (rev 160994)
@@ -1,3 +1,13 @@
+2013-12-22  Martin Robinson  <mrobin...@igalia.com>
+
+        [GTK][CMake] libtool-compatible soversion calculation
+        https://bugs.webkit.org/show_bug.cgi?id=125511
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * CMakeLists.txt: Use the POPULATE_LIBRARY_VERSION macro and the
+        library-specific version information.
+
 2013-12-23  Gustavo Noronha Silva  <g...@gnome.org>
 
         [GTK] [CMake] Generate pkg-config files

Modified: trunk/Source/WebKit/CMakeLists.txt (160993 => 160994)


--- trunk/Source/WebKit/CMakeLists.txt	2013-12-23 13:35:00 UTC (rev 160993)
+++ trunk/Source/WebKit/CMakeLists.txt	2013-12-23 14:45:44 UTC (rev 160994)
@@ -117,5 +117,6 @@
     set_target_properties(WebKit PROPERTIES OUTPUT_NAME ${WebKit_OUTPUT_NAME})
 endif ()
 
-set_target_properties(WebKit PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
+POPULATE_LIBRARY_VERSION(WEBKIT)
+set_target_properties(WebKit PROPERTIES VERSION ${WEBKIT_VERSION} SOVERSION ${WEBKIT_VERSION_MAJOR})
 install(TARGETS WebKit DESTINATION "${LIB_INSTALL_DIR}")

Modified: trunk/Source/WebKit/ChangeLog (160993 => 160994)


--- trunk/Source/WebKit/ChangeLog	2013-12-23 13:35:00 UTC (rev 160993)
+++ trunk/Source/WebKit/ChangeLog	2013-12-23 14:45:44 UTC (rev 160994)
@@ -1,3 +1,13 @@
+2013-12-22  Martin Robinson  <mrobin...@igalia.com>
+
+        [GTK][CMake] libtool-compatible soversion calculation
+        https://bugs.webkit.org/show_bug.cgi?id=125511
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * CMakeLists.txt: Use the POPULATE_LIBRARY_VERSION macro and the
+        library-specific version information.
+
 2013-12-23  Gustavo Noronha Silva  <g...@gnome.org>
 
         [GTK] [CMake] Generate pkg-config files

Modified: trunk/Source/WebKit2/CMakeLists.txt (160993 => 160994)


--- trunk/Source/WebKit2/CMakeLists.txt	2013-12-23 13:35:00 UTC (rev 160993)
+++ trunk/Source/WebKit2/CMakeLists.txt	2013-12-23 14:45:44 UTC (rev 160994)
@@ -707,7 +707,8 @@
     set_target_properties(WebProcess PROPERTIES OUTPUT_NAME ${WebKit2_WebProcess_OUTPUT_NAME})
 endif ()
 
-set_target_properties(WebKit2 PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
+POPULATE_LIBRARY_VERSION(WEBKIT2)
+set_target_properties(WebKit2 PROPERTIES VERSION ${WEBKIT2_VERSION} SOVERSION ${WEBKIT2_VERSION_MAJOR})
 
 install(TARGETS WebKit2 DESTINATION "${LIB_INSTALL_DIR}")
 install(TARGETS WebProcess DESTINATION "${EXEC_INSTALL_DIR}")

Modified: trunk/Source/WebKit2/ChangeLog (160993 => 160994)


--- trunk/Source/WebKit2/ChangeLog	2013-12-23 13:35:00 UTC (rev 160993)
+++ trunk/Source/WebKit2/ChangeLog	2013-12-23 14:45:44 UTC (rev 160994)
@@ -1,3 +1,13 @@
+2013-12-22  Martin Robinson  <mrobin...@igalia.com>
+
+        [GTK][CMake] libtool-compatible soversion calculation
+        https://bugs.webkit.org/show_bug.cgi?id=125511
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * CMakeLists.txt: Use the POPULATE_LIBRARY_VERSION macro and the
+        library-specific version information.
+
 2013-12-23  Gustavo Noronha Silva  <g...@gnome.org>
 
         [GTK] [CMake] Generate pkg-config files

Modified: trunk/Source/cmake/OptionsGTK.cmake (160993 => 160994)


--- trunk/Source/cmake/OptionsGTK.cmake	2013-12-23 13:35:00 UTC (rev 160993)
+++ trunk/Source/cmake/OptionsGTK.cmake	2013-12-23 14:45:44 UTC (rev 160994)
@@ -1,5 +1,26 @@
 include(GNUInstallDirs)
 
+set(PROJECT_VERSION_MAJOR 2)
+set(PROJECT_VERSION_MINOR 3)
+set(PROJECT_VERSION_PATCH 3)
+set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
+
+# Libtool library version, not to be confused with API version.
+# See http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
+CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT 22 0 22)
+CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT2 32 0 7)
+CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(_javascript_CORE 16 2 16)
+
+# This is a little confusing: WEBKIT_MICRO_VERSION and friends are used as
+# macros in files like WebKitVersion.h.in to expose the project version to
+# the API. Meanwhile WEBKIT_VERSION_MICRO (note the transposed words) is used
+# by the CMake files to hold the *library* version number, which we calculated
+# from the libtool triple above. We should consider ditching these below
+# and using PROJECT_VERSION_* directly.
+set(WEBKIT_MICRO_VERSION ${PROJECT_VERSION_PATCH})
+set(WEBKIT_MINOR_VERSION ${PROJECT_VERSION_MINOR})
+set(WEBKIT_MAJOR_VERSION ${PROJECT_VERSION_MAJOR})
+
 # FIXME: We want to expose fewer options to downstream, but for now everything is public.
 WEBKIT_OPTION_BEGIN()
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_3D_RENDERING ON)
@@ -59,15 +80,6 @@
 endif ()
 WEBKIT_OPTION_END()
 
-set(PROJECT_VERSION_MAJOR 2)
-set(PROJECT_VERSION_MINOR 3)
-set(PROJECT_VERSION_PATCH 3)
-set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
-
-set(WEBKIT_MICRO_VERSION ${PROJECT_VERSION_PATCH})
-set(WEBKIT_MINOR_VERSION ${PROJECT_VERSION_MINOR})
-set(WEBKIT_MAJOR_VERSION ${PROJECT_VERSION_MAJOR})
-
 # These are used to generate the pkg-config files, note we only support GTK 3.0
 # builds with cmake.
 set(WEBKITGTK_API_VERSION 3.0)

Modified: trunk/Source/cmake/WebKitHelpers.cmake (160993 => 160994)


--- trunk/Source/cmake/WebKitHelpers.cmake	2013-12-23 13:35:00 UTC (rev 160993)
+++ trunk/Source/cmake/WebKitHelpers.cmake	2013-12-23 14:45:44 UTC (rev 160994)
@@ -100,3 +100,25 @@
     ADD_SOURCE_DEPENDENCIES(${_source} ${_tmp})
     unset(_tmp)
 endmacro()
+
+macro(CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE library_name current revision age)
+    math(EXPR ${library_name}_VERSION_MAJOR "${current} - ${age}")
+    set(${library_name}_VERSION_MINOR ${age})
+    set(${library_name}_VERSION_PATCH ${revision})
+    set(${library_name}_VERSION ${${library_name}_VERSION_MAJOR}.${age}.${revision})
+endmacro()
+
+macro(POPULATE_LIBRARY_VERSION library_name)
+if (NOT DEFINED ${library_name}_VERSION_MAJOR)
+    set(${library_name}_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
+endif ()
+if (NOT DEFINED ${library_name}_VERSION_MINOR)
+    set(${library_name}_VERSION_MINOR ${PROJECT_VERSION_MINOR})
+endif ()
+if (NOT DEFINED ${library_name}_VERSION_PATCH)
+    set(${library_name}_VERSION_PATCH ${PROJECT_VERSION_PATCH})
+endif ()
+if (NOT DEFINED ${library_name}_VERSION)
+    set(${library_name}_VERSION ${PROJECT_VERSION})
+endif ()
+endmacro()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to