[cmake] Added an option to disable thin archives when they are undesirable.
authorannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Sep 2016 18:57:32 +0000 (18:57 +0000)
committerannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Sep 2016 18:57:32 +0000 (18:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=162561

Reviewed by Michael Catanzaro.

* Source/cmake/OptionsCommon.cmake: Added USE_THIN_ARCHIVES option.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206384 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/cmake/OptionsCommon.cmake

index 5f45125..830a9fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-09-26  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [cmake] Added an option to disable thin archives when they are undesirable.
+        https://bugs.webkit.org/show_bug.cgi?id=162561
+
+        Reviewed by Michael Catanzaro.
+
+        * Source/cmake/OptionsCommon.cmake: Added USE_THIN_ARCHIVES option.
+
 2016-09-23  Caitlin Potter  <caitp@igalia.com>
 
         [JSC] Implement parsing of Async Functions
index 20b83e6..da70ab5 100644 (file)
@@ -15,12 +15,15 @@ else ()
     set(CODE_GENERATOR_PREPROCESSOR_WITH_LINEMARKERS "${CMAKE_CXX_COMPILER} -E -x c++")
 endif ()
 
-execute_process(COMMAND ${CMAKE_AR} -V OUTPUT_VARIABLE AR_VERSION)
-if ("${AR_VERSION}" MATCHES "^GNU ar")
-    set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> crT <TARGET> <LINK_FLAGS> <OBJECTS>")
-    set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> crT <TARGET> <LINK_FLAGS> <OBJECTS>")
-    set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> rT <TARGET> <LINK_FLAGS> <OBJECTS>")
-    set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> rT <TARGET> <LINK_FLAGS> <OBJECTS>")
+option(USE_THIN_ARCHIVES "Produce all static libraries as thin archives" ON)
+if (USE_THIN_ARCHIVES)
+    execute_process(COMMAND ${CMAKE_AR} -V OUTPUT_VARIABLE AR_VERSION)
+    if ("${AR_VERSION}" MATCHES "^GNU ar")
+        set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> crT <TARGET> <LINK_FLAGS> <OBJECTS>")
+        set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> crT <TARGET> <LINK_FLAGS> <OBJECTS>")
+        set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> rT <TARGET> <LINK_FLAGS> <OBJECTS>")
+        set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> rT <TARGET> <LINK_FLAGS> <OBJECTS>")
+    endif ()
 endif ()
 
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)