[cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Feb 2016 19:32:47 +0000 (19:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Feb 2016 19:32:47 +0000 (19:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154450

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-02-22
Reviewed by Alex Christensen.

.:

* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

* CMakeLists.txt:

Source/WebCore:

No new tests needed.

* CMakeLists.txt:

Source/WebKit:

* CMakeLists.txt:

Source/WebKit2:

* CMakeLists.txt: Used WebKit2_SOURCES variable instead of separate
WebKit2_DERIVED_SOURCES for compatibility with WEBKIT_FRAMEWORK macro.
There is no real need to separate derived sources from others.
* PlatformGTK.cmake: Ditto.

Source/WTF:

* wtf/CMakeLists.txt:

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

12 files changed:
ChangeLog
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/WTF/ChangeLog
Source/WTF/wtf/CMakeLists.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/cmake/WebKitMacros.cmake

index 248a8f9..c84b02a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-02-22  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
+        https://bugs.webkit.org/show_bug.cgi?id=154450
+
+        Reviewed by Alex Christensen.
+
+        * Source/cmake/WebKitMacros.cmake:
+
 2016-02-18  Philippe Normand  <pnormand@igalia.com>
 
         [GStreamer] Bump internal jhbuild versions to 1.6.3
index 0254487..0394e1e 100644 (file)
@@ -1310,12 +1310,7 @@ WEBKIT_CREATE_FORWARDING_HEADERS(JavaScriptCore DIRECTORIES ${JavaScriptCore_FOR
 add_subdirectory(shell)
 
 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
-include_directories(${JavaScriptCore_INCLUDE_DIRECTORIES})
-include_directories(SYSTEM ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
-add_library(JavaScriptCore ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
-target_link_libraries(JavaScriptCore ${JavaScriptCore_LIBRARIES})
-set_target_properties(JavaScriptCore PROPERTIES COMPILE_DEFINITIONS "BUILDING_JavaScriptCore")
-set_target_properties(JavaScriptCore PROPERTIES FOLDER "JavaScriptCore")
+WEBKIT_FRAMEWORK(JavaScriptCore)
 
 if (JavaScriptCore_PRE_BUILD_COMMAND)
     add_custom_command(TARGET JavaScriptCore PRE_BUILD COMMAND ${JavaScriptCore_PRE_BUILD_COMMAND} VERBATIM)
@@ -1325,10 +1320,6 @@ if (JavaScriptCore_POST_BUILD_COMMAND)
     add_custom_command(TARGET JavaScriptCore POST_BUILD COMMAND ${JavaScriptCore_POST_BUILD_COMMAND} VERBATIM)
 endif ()
 
-if (JavaScriptCore_OUTPUT_NAME)
-    set_target_properties(JavaScriptCore PROPERTIES OUTPUT_NAME ${JavaScriptCore_OUTPUT_NAME})
-endif ()
-
 if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED")
     POPULATE_LIBRARY_VERSION(JAVASCRIPTCORE)
     set_target_properties(JavaScriptCore PROPERTIES VERSION ${JAVASCRIPTCORE_VERSION} SOVERSION ${JAVASCRIPTCORE_VERSION_MAJOR})
@@ -1339,5 +1330,3 @@ endif ()
 
 add_custom_target(stageSharedScripts DEPENDS ${JavaScriptCore_SCRIPTS})
 add_dependencies(JavaScriptCore stageSharedScripts)
-
-WEBKIT_FRAMEWORK(JavaScriptCore)
index 25c88c7..4581bb2 100644 (file)
@@ -1,3 +1,12 @@
+2016-02-22  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
+        https://bugs.webkit.org/show_bug.cgi?id=154450
+
+        Reviewed by Alex Christensen.
+
+        * CMakeLists.txt:
+
 2016-02-22  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r196891.
index fccf750..27afb46 100644 (file)
@@ -1,3 +1,12 @@
+2016-02-22  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
+        https://bugs.webkit.org/show_bug.cgi?id=154450
+
+        Reviewed by Alex Christensen.
+
+        * wtf/CMakeLists.txt:
+
 2016-02-20  Mark Lam  <mark.lam@apple.com>
 
         Use of inlined asm statements causes problems for -std=c99 builds.
index f0b24c8..67a2394 100644 (file)
@@ -284,12 +284,7 @@ endif ()
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
 WEBKIT_WRAP_SOURCELIST(${WTF_SOURCES})
-include_directories(${WTF_INCLUDE_DIRECTORIES})
-include_directories(SYSTEM ${WTF_SYSTEM_INCLUDE_DIRECTORIES})
-add_library(WTF ${WTF_LIBRARY_TYPE} ${WTF_HEADERS} ${WTF_SOURCES})
-target_link_libraries(WTF ${WTF_LIBRARIES})
-set_target_properties(WTF PROPERTIES COMPILE_DEFINITIONS "BUILDING_WTF")
-set_target_properties(WTF PROPERTIES FOLDER "JavaScriptCore")
+WEBKIT_FRAMEWORK(WTF)
 
 if (MSVC)
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
@@ -299,9 +294,3 @@ endif ()
 if (WTF_PRE_BUILD_COMMAND)
     add_custom_command(TARGET WTF PRE_BUILD COMMAND ${WTF_PRE_BUILD_COMMAND} VERBATIM)
 endif ()
-
-if (WTF_OUTPUT_NAME)
-    set_target_properties(WTF PROPERTIES OUTPUT_NAME ${WTF_OUTPUT_NAME})
-endif ()
-
-WEBKIT_FRAMEWORK(WTF)
index 9df01d0..fca90a6 100644 (file)
@@ -3771,16 +3771,11 @@ list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/XMLNames.cpp)
 WEBKIT_WRAP_SOURCELIST(${WebCore_IDL_FILES} ${WebCore_SOURCES})
 WEBKIT_WRAP_SOURCELIST(${WebCoreTestSupport_IDL_FILES} ${WebCoreTestSupport_SOURCES})
 
-include_directories(${WebCore_INCLUDE_DIRECTORIES} ${WebCoreTestSupport_INCLUDE_DIRECTORIES})
-include_directories(SYSTEM ${WebCore_SYSTEM_INCLUDE_DIRECTORIES})
-
 if (MSVC)
     ADD_PRECOMPILED_HEADER("WebCorePrefix.h" "WebCorePrefix.cpp" WebCore_SOURCES)
 endif ()
 
-add_library(WebCore ${WebCore_LIBRARY_TYPE} ${WebCore_SOURCES})
-set_target_properties(WebCore PROPERTIES COMPILE_DEFINITIONS "BUILDING_WebCore")
-set_target_properties(WebCore PROPERTIES FOLDER "WebCore")
+WEBKIT_FRAMEWORK(WebCore)
 
 # The -ftree-sra optimization (implicit with -O2) causes crashes when
 # allocating large chunks of memory using bmalloc on Intel 32bit.
@@ -3799,14 +3794,11 @@ if (WebCore_POST_BUILD_COMMAND)
     add_custom_command(TARGET WebCore POST_BUILD COMMAND ${WebCore_POST_BUILD_COMMAND} VERBATIM)
 endif ()
 
-if (WebCore_OUTPUT_NAME)
-    set_target_properties(WebCore PROPERTIES OUTPUT_NAME ${WebCore_OUTPUT_NAME})
-endif ()
-
 if (MSVC)
     ADD_PRECOMPILED_HEADER("WebCoreTestSupportPrefix.h" "testing/js/WebCoreTestSupportPrefix.cpp" WebCoreTestSupport_SOURCES)
 endif ()
 
+include_directories(${WebCoreTestSupport_INCLUDE_DIRECTORIES})
 add_library(WebCoreTestSupport ${WebCoreTestSupport_LIBRARY_TYPE} ${WebCoreTestSupport_SOURCES})
 add_dependencies(WebCoreTestSupport WebCore)
 target_link_libraries(WebCoreTestSupport ${WebCoreTestSupport_LIBRARIES})
@@ -3848,5 +3840,3 @@ endif ()
 if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND WTF_CPU_ARM AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.9") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9.3"))
     set_source_files_properties(svg/SVGPathElement.cpp PROPERTIES COMPILE_FLAGS "-O2")
 endif ()
-
-WEBKIT_FRAMEWORK(WebCore)
index 587458e..602b9e8 100644 (file)
@@ -1,5 +1,16 @@
 2016-02-22  Konstantin Tokarev  <annulen@yandex.ru>
 
+        [cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
+        https://bugs.webkit.org/show_bug.cgi?id=154450
+
+        Reviewed by Alex Christensen.
+
+        No new tests needed.
+
+        * CMakeLists.txt:
+
+2016-02-22  Konstantin Tokarev  <annulen@yandex.ru>
+
         Workaround for ICE in GCC 4.8 appeared in r196846.
         https://bugs.webkit.org/show_bug.cgi?id=154535
 
index 101221f..e0e62c2 100644 (file)
@@ -27,25 +27,15 @@ set(WebKit_LIBRARIES
 
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
-include_directories(${WebKit_INCLUDE_DIRECTORIES})
-include_directories(SYSTEM ${WebKit_SYSTEM_INCLUDE_DIRECTORIES})
-
 if (MSVC)
     ADD_PRECOMPILED_HEADER("WebKitPrefix.h" "win/WebKitPrefix.cpp" WebKit_SOURCES)
     list(APPEND WebKit_SOURCES win/WebKit.resources/WebKit.rc)
     add_definitions(/DWEBKIT_EXPORTS /DFRAMEWORK_NAME=WebKit)
 endif ()
 
-add_library(WebKit ${WebKit_LIBRARY_TYPE} ${WebKit_SOURCES})
+WEBKIT_FRAMEWORK(WebKit)
+
 add_dependencies(WebKit WebCore)
 if (WIN32)
     add_dependencies(WebKit WebKitGUID)
 endif ()
-target_link_libraries(WebKit ${WebKit_LIBRARIES})
-set_target_properties(WebKit PROPERTIES FOLDER "WebKit")
-
-if (WebKit_OUTPUT_NAME)
-    set_target_properties(WebKit PROPERTIES OUTPUT_NAME ${WebKit_OUTPUT_NAME})
-endif ()
-
-WEBKIT_FRAMEWORK(WebKit)
index bf7f8a0..5cae7ec 100644 (file)
@@ -1,3 +1,12 @@
+2016-02-22  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
+        https://bugs.webkit.org/show_bug.cgi?id=154450
+
+        Reviewed by Alex Christensen.
+
+        * CMakeLists.txt:
+
 2016-02-15  Alex Christensen  <achristensen@webkit.org>
 
         Fix internal Windows build of projects built after WebKit
index 23d899b..9afd15a 100644 (file)
@@ -770,14 +770,9 @@ WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
 GENERATE_WEBKIT2_MESSAGE_SOURCES(WebKit2_DERIVED_SOURCES "${WebKit2_MESSAGES_IN_FILES}")
 
-include_directories(${WebKit2_INCLUDE_DIRECTORIES})
-include_directories(SYSTEM ${WebKit2_SYSTEM_INCLUDE_DIRECTORIES})
-add_library(WebKit2 ${WebKit2_LIBRARY_TYPE} ${WebKit2_SOURCES} ${WebKit2_DERIVED_SOURCES})
-
+WEBKIT_FRAMEWORK(WebKit2)
 add_dependencies(WebKit2 WebCore ${WEBKIT2_EXTRA_DEPENDENCIES})
 add_webkit2_prefix_header(WebKit2)
-target_link_libraries(WebKit2 ${WebKit2_LIBRARIES})
-set_target_properties(WebKit2 PROPERTIES FOLDER "WebKit")
 
 # Suppress unused parameter warnings for sources in WebKit2.
 ADD_TARGET_PROPERTIES(WebKit2 COMPILE_FLAGS "-Wno-unused-parameter")
@@ -786,10 +781,6 @@ if (WebKit2_VERSION_SCRIPT)
     ADD_TARGET_PROPERTIES(WebKit2 LINK_FLAGS "${WebKit2_VERSION_SCRIPT}")
 endif ()
 
-if (WebKit2_OUTPUT_NAME)
-    set_target_properties(WebKit2 PROPERTIES OUTPUT_NAME ${WebKit2_OUTPUT_NAME})
-endif ()
-
 add_executable(WebProcess ${WebProcess_SOURCES})
 add_webkit2_prefix_header(WebProcess)
 target_link_libraries(WebProcess ${WebProcess_LIBRARIES})
@@ -837,9 +828,7 @@ endif ()
 POPULATE_LIBRARY_VERSION(WEBKIT2)
 set_target_properties(WebKit2 PROPERTIES VERSION ${WEBKIT2_VERSION} SOVERSION ${WEBKIT2_VERSION_MAJOR})
 
-if (APPLE)
-    WEBKIT_FRAMEWORK(WebKit2)
-else ()
+if (NOT APPLE)
     install(TARGETS WebKit2 WebProcess NetworkProcess
         LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
         RUNTIME DESTINATION "${LIBEXEC_INSTALL_DIR}"
index ab0424d..d0e3abb 100644 (file)
@@ -1,3 +1,15 @@
+2016-02-22  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
+        https://bugs.webkit.org/show_bug.cgi?id=154450
+
+        Reviewed by Alex Christensen.
+
+        * CMakeLists.txt: Used WebKit2_SOURCES variable instead of separate
+        WebKit2_DERIVED_SOURCES for compatibility with WEBKIT_FRAMEWORK macro.
+        There is no real need to separate derived sources from others.
+        * PlatformGTK.cmake: Ditto.
+
 2016-02-22  Carlos Alberto Lopez Perez  <clopez@igalia.com>
 
         [CMake] Unreviewed build fix after r196942.
index 6a46452..852a1c0 100644 (file)
@@ -243,6 +243,21 @@ macro(WEBKIT_WRAP_SOURCELIST)
 endmacro()
 
 macro(WEBKIT_FRAMEWORK _target)
+    include_directories(${${_target}_INCLUDE_DIRECTORIES})
+    include_directories(SYSTEM ${${_target}_SYSTEM_INCLUDE_DIRECTORIES})
+    add_library(${_target} ${${_target}_LIBRARY_TYPE}
+        ${${_target}_HEADERS}
+        ${${_target}_SOURCES}
+        ${${_target}_DERIVED_SOURCES}
+    )
+    target_link_libraries(${_target} ${${_target}_LIBRARIES})
+    set_target_properties(${_target} PROPERTIES COMPILE_DEFINITIONS "BUILDING_${_target}")
+    set_target_properties(${_target} PROPERTIES FOLDER "${_target}")
+
+    if (${_target}_OUTPUT_NAME)
+        set_target_properties(${_target} PROPERTIES OUTPUT_NAME ${${_target}_OUTPUT_NAME})
+    endif ()
+
     if (APPLE AND NOT PORT STREQUAL "GTK")
         set_target_properties(${_target} PROPERTIES FRAMEWORK TRUE)
         install(TARGETS ${_target} FRAMEWORK DESTINATION ${LIB_INSTALL_DIR})