[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 May 2019 20:37:41 +0000 (20:37 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 May 2019 20:37:41 +0000 (20:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197174

Reviewed by Alex Christensen.

.:

Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES which is a general
purpose macro that copies files to a destination. WEBKIT_COPY_FILES removes the
requirement of a target being passed in so there is no longer any implicit dependency
between the target and the copying. Instead the dependencies need to be explicit.

This opens the macro up for use by third party libraries and for copying other files
to a destination.

* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
for framework headers explicit.

* CMakeLists.txt:

Source/WebCore:

Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
for framework headers explicit.

* CMakeLists.txt:

Source/WebCore/PAL:

Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES.

* pal/CMakeLists.txt:

Source/WebKit:

Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
for framework headers explicit.

* CMakeLists.txt:
* PlatformWin.cmake:

Source/WebKitLegacy:

Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
for framework headers explicit.

* PlatformWin.cmake:

Source/WTF:

Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES.

* wtf/CMakeLists.txt:

Tools:

Make TestJSC dependent on JavaScriptCorePrivateFrameworkHeaders.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWPE.cmake:

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

18 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/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/CMakeLists.txt
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit/PlatformWin.cmake
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/PlatformWin.cmake
Source/cmake/WebKitMacros.cmake
Tools/ChangeLog
Tools/TestWebKitAPI/PlatformGTK.cmake
Tools/TestWebKitAPI/PlatformWPE.cmake

index 00d7391..2316a40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2019-05-02  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
+        https://bugs.webkit.org/show_bug.cgi?id=197174
+
+        Reviewed by Alex Christensen.
+
+        Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES which is a general
+        purpose macro that copies files to a destination. WEBKIT_COPY_FILES removes the
+        requirement of a target being passed in so there is no longer any implicit dependency
+        between the target and the copying. Instead the dependencies need to be explicit.
+
+        This opens the macro up for use by third party libraries and for copying other files
+        to a destination.
+
+        * Source/cmake/WebKitMacros.cmake:
+
 2019-05-01  Stephan Szabo  <stephan.szabo@sony.com>
 
         [PlayStation] Update port for WEBKIT_EXECUTABLE changes
index a12c074..86a73f8 100644 (file)
@@ -296,9 +296,9 @@ add_executable(LLIntOffsetsExtractor
 )
 
 target_link_libraries(LLIntSettingsExtractor WTF)
-add_dependencies(LLIntSettingsExtractor JavaScriptCoreFrameworkHeaders)
+add_dependencies(LLIntSettingsExtractor JavaScriptCoreFrameworkHeaders WTFFrameworkHeaders)
 target_link_libraries(LLIntOffsetsExtractor WTF)
-add_dependencies(LLIntOffsetsExtractor JavaScriptCoreFrameworkHeaders)
+add_dependencies(LLIntOffsetsExtractor JavaScriptCoreFrameworkHeaders WTFFrameworkHeaders)
 
 # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
 # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
@@ -1274,20 +1274,6 @@ if (COMPILER_IS_GCC_OR_CLANG)
     WEBKIT_ADD_TARGET_CXX_FLAGS(JavaScriptCore -ffp-contract=off)
 endif ()
 
-WEBKIT_MAKE_FORWARDING_HEADERS(JavaScriptCore
-    TARGET_NAME JavaScriptCoreFrameworkHeaders
-    DESTINATION ${JavaScriptCore_FRAMEWORK_HEADERS_DIR}/JavaScriptCore
-    FILES ${JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS}
-    FLATTENED
-)
-
-WEBKIT_MAKE_FORWARDING_HEADERS(JavaScriptCore
-    TARGET_NAME JavaScriptCorePrivateFrameworkHeaders
-    DESTINATION ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS_DIR}/JavaScriptCore
-    FILES ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS}
-    FLATTENED
-)
-
 target_include_directories(LLIntSettingsExtractor PRIVATE
     ${JavaScriptCore_INCLUDE_DIRECTORIES}
     ${JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES}
@@ -1306,6 +1292,21 @@ WEBKIT_COMPUTE_SOURCES(JavaScriptCore)
 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
 WEBKIT_FRAMEWORK(JavaScriptCore)
 
+WEBKIT_COPY_FILES(JavaScriptCoreFrameworkHeaders
+    DESTINATION ${JavaScriptCore_FRAMEWORK_HEADERS_DIR}/JavaScriptCore
+    FILES ${JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS}
+    FLATTENED
+)
+
+WEBKIT_COPY_FILES(JavaScriptCorePrivateFrameworkHeaders
+    DESTINATION ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS_DIR}/JavaScriptCore
+    FILES ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS}
+    FLATTENED
+)
+
+add_dependencies(JavaScriptCore JavaScriptCoreFrameworkHeaders)
+add_dependencies(JavaScriptCorePrivateFrameworkHeaders JavaScriptCore)
+
 if (NOT "${PORT}" STREQUAL "Mac")
     if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED")
         WEBKIT_POPULATE_LIBRARY_VERSION(JAVASCRIPTCORE)
index 2d4298f..7b7f0f6 100644 (file)
@@ -1,3 +1,15 @@
+2019-05-02  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
+        https://bugs.webkit.org/show_bug.cgi?id=197174
+
+        Reviewed by Alex Christensen.
+
+        Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
+        for framework headers explicit.
+
+        * CMakeLists.txt:
+
 2019-05-02  Michael Saboff  <msaboff@apple.com>
 
         Unreviewed rollout of r244862.
index 9f68e2f..45358a8 100644 (file)
@@ -1,3 +1,14 @@
+2019-05-02  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
+        https://bugs.webkit.org/show_bug.cgi?id=197174
+
+        Reviewed by Alex Christensen.
+
+        Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES.
+
+        * wtf/CMakeLists.txt:
+
 2019-05-01  Darin Adler  <darin@apple.com>
 
         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
index 5a8bb51..b84cc77 100644 (file)
@@ -503,8 +503,7 @@ WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 WEBKIT_WRAP_SOURCELIST(${WTF_SOURCES})
 WEBKIT_FRAMEWORK(WTF)
 
-WEBKIT_MAKE_FORWARDING_HEADERS(WTF
-    TARGET_NAME WTFFrameworkHeaders
+WEBKIT_COPY_FILES(WTFFrameworkHeaders
     DESTINATION ${WTF_FRAMEWORK_HEADERS_DIR}/wtf
     FILES ${WTF_PUBLIC_HEADERS}
 )
index e06abb5..75de748 100644 (file)
@@ -1763,13 +1763,6 @@ set(PAINTWORKLETGLOBALSCOPE_CONSTRUCTORS_FILE ${WebCore_DERIVED_SOURCES_DIR}/Pai
 WEBKIT_FRAMEWORK_DECLARE(WebCore)
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
-WEBKIT_MAKE_FORWARDING_HEADERS(WebCore
-    TARGET_NAME WebCorePrivateFrameworkHeaders
-    DESTINATION ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}/WebCore
-    FILES ${WebCore_PRIVATE_FRAMEWORK_HEADERS}
-    FLATTENED
-)
-
 # Generate CommandLineAPIModuleSource.h
 add_custom_command(
     OUTPUT ${WebCore_DERIVED_SOURCES_DIR}/CommandLineAPIModuleSource.h ${WebCore_DERIVED_SOURCES_DIR}/CommandLineAPIModuleSource.min.js
@@ -2079,7 +2072,17 @@ endif ()
 
 WEBKIT_FRAMEWORK(WebCore)
 
-add_dependencies(WebCore WebCoreBindings)
+WEBKIT_COPY_FILES(WebCorePrivateFrameworkHeaders
+    DESTINATION ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}/WebCore
+    FILES ${WebCore_PRIVATE_FRAMEWORK_HEADERS}
+    FLATTENED
+)
+
+add_dependencies(WebCore
+    PALFrameworkHeaders
+    JavaScriptCorePrivateFrameworkHeaders
+    WebCoreBindings
+)
 add_dependencies(WebCorePrivateFrameworkHeaders WebCoreBindings)
 
 if (APPLE)
index 2446229..797f676 100644 (file)
@@ -1,3 +1,15 @@
+2019-05-02  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
+        https://bugs.webkit.org/show_bug.cgi?id=197174
+
+        Reviewed by Alex Christensen.
+
+        Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
+        for framework headers explicit.
+
+        * CMakeLists.txt:
+
 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
 
         [WebAuthN] Add a quirk for google.com when processing AppID extension
index 72c230e..9549e18 100644 (file)
@@ -1,3 +1,14 @@
+2019-05-02  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
+        https://bugs.webkit.org/show_bug.cgi?id=197174
+
+        Reviewed by Alex Christensen.
+
+        Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES.
+
+        * pal/CMakeLists.txt:
+
 2019-04-29  Alex Christensen  <achristensen@webkit.org>
 
         <rdar://problem/50299396> Fix internal High Sierra build
index c50c485..c7a0804 100644 (file)
@@ -51,8 +51,7 @@ WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 WEBKIT_WRAP_SOURCELIST(${PAL_SOURCES})
 WEBKIT_FRAMEWORK(PAL)
 
-WEBKIT_MAKE_FORWARDING_HEADERS(PAL
-    TARGET_NAME PALFrameworkHeaders
+WEBKIT_COPY_FILES(PALFrameworkHeaders
     DESTINATION ${PAL_FRAMEWORK_HEADERS_DIR}/pal
     FILES ${PAL_PUBLIC_HEADERS}
 )
index ce4f200..f17532c 100644 (file)
@@ -421,7 +421,7 @@ list(APPEND WebKit_SOURCES ${WebKit_DERIVED_SOURCES})
 WEBKIT_COMPUTE_SOURCES(WebKit)
 
 WEBKIT_FRAMEWORK(WebKit)
-add_dependencies(WebKit WebCore ${WEBKIT_EXTRA_DEPENDENCIES})
+add_dependencies(WebKit WebCore WebCorePrivateFrameworkHeaders ${WEBKIT_EXTRA_DEPENDENCIES})
 ADD_WEBKIT_PREFIX_HEADER(WebKit)
 
 add_executable(WebProcess ${WebProcess_SOURCES})
index 09e874e..15c4569 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-02  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
+        https://bugs.webkit.org/show_bug.cgi?id=197174
+
+        Reviewed by Alex Christensen.
+
+        Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
+        for framework headers explicit.
+
+        * CMakeLists.txt:
+        * PlatformWin.cmake:
+
 2019-05-02  Per Arne Vollan  <pvollan@apple.com>
 
         [macOS] Fix syscall sandbox violation
index 4e9e2a6..9e15929 100644 (file)
@@ -370,8 +370,7 @@ if (${WTF_PLATFORM_WIN_CAIRO})
     )
 endif ()
 
-WEBKIT_MAKE_FORWARDING_HEADERS(WebKit
-    TARGET_NAME WebKitFrameworkHeaders
+WEBKIT_COPY_FILES(WebKitFrameworkHeaders
     DESTINATION ${WebKit_FRAMEWORK_HEADERS_DIR}/WebKit
     FILES ${WebKit_PUBLIC_FRAMEWORK_HEADERS}
     FLATTENED
index 4f75c6a..5cc4231 100644 (file)
@@ -1,3 +1,15 @@
+2019-05-02  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
+        https://bugs.webkit.org/show_bug.cgi?id=197174
+
+        Reviewed by Alex Christensen.
+
+        Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
+        for framework headers explicit.
+
+        * PlatformWin.cmake:
+
 2019-04-25  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         Unreviewed, rolling out r244669.
index 3506b15..bb9fd77 100644 (file)
@@ -496,13 +496,12 @@ set(WebKitLegacy_PUBLIC_FRAMEWORK_HEADERS
     win/WebKitCOMAPI.h
 )
 
-WEBKIT_MAKE_FORWARDING_HEADERS(WebKitLegacyGUID
-    TARGET_NAME WebKitLegacyFrameworkHeaders
+WEBKIT_COPY_FILES(WebKitLegacyFrameworkHeaders
     DESTINATION ${WebKitLegacy_FRAMEWORK_HEADERS_DIR}/WebKitLegacy
     FILES ${WebKitLegacy_PUBLIC_FRAMEWORK_HEADERS}
     FLATTENED
 )
-add_dependencies(WebKitLegacyFrameworkHeaders WebCorePrivateFrameworkHeaders)
+add_dependencies(WebKitLegacyFrameworkHeaders WebKitLegacyGUID)
 
 set(WebKitLegacy_OUTPUT_NAME
     WebKit${DEBUG_SUFFIX}
index 4aacbd6..aee62f0 100644 (file)
@@ -291,46 +291,35 @@ macro(WEBKIT_CREATE_FORWARDING_HEADERS _framework)
     endif ()
 endmacro()
 
-function(WEBKIT_MAKE_FORWARDING_HEADERS framework)
+function(WEBKIT_COPY_FILES target_name)
     set(options FLATTENED)
-    set(oneValueArgs DESTINATION TARGET_NAME)
-    set(multiValueArgs DIRECTORIES FILES)
+    set(oneValueArgs DESTINATION)
+    set(multiValueArgs FILES)
     cmake_parse_arguments(opt "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
-    set(headers ${opt_FILES})
-    file(MAKE_DIRECTORY ${opt_DESTINATION})
-    foreach (dir IN LISTS opt_DIRECTORIES)
-        file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${dir}/*.h)
-        list(APPEND headers ${files})
-    endforeach ()
-    set(fwd_headers)
-    foreach (header IN LISTS headers)
-        if (IS_ABSOLUTE ${header})
-            set(src_header ${header})
+    set(files ${opt_FILES})
+    set(dst_files)
+    foreach (file IN LISTS files)
+        if (IS_ABSOLUTE ${file})
+            set(src_file ${file})
         else ()
-            set(src_header ${CMAKE_CURRENT_SOURCE_DIR}/${header})
+            set(src_file ${CMAKE_CURRENT_SOURCE_DIR}/${file})
         endif ()
         if (opt_FLATTENED)
-            get_filename_component(header_filename ${header} NAME)
-            set(fwd_header ${opt_DESTINATION}/${header_filename})
+            get_filename_component(filename ${file} NAME)
+            set(dst_file ${opt_DESTINATION}/${filename})
         else ()
-            get_filename_component(header_dir ${header} DIRECTORY)
-            file(MAKE_DIRECTORY ${opt_DESTINATION}/${header_dir})
-            set(fwd_header ${opt_DESTINATION}/${header})
+            get_filename_component(file_dir ${file} DIRECTORY)
+            file(MAKE_DIRECTORY ${opt_DESTINATION}/${file_dir})
+            set(dst_file ${opt_DESTINATION}/${file})
         endif ()
-        add_custom_command(OUTPUT ${fwd_header}
-            COMMAND ${CMAKE_COMMAND} -E copy ${src_header} ${fwd_header}
-            MAIN_DEPENDENCY ${header}
+        add_custom_command(OUTPUT ${dst_file}
+            COMMAND ${CMAKE_COMMAND} -E copy ${src_file} ${dst_file}
+            MAIN_DEPENDENCY ${file}
             VERBATIM
         )
-        list(APPEND fwd_headers ${fwd_header})
+        list(APPEND dst_files ${dst_file})
     endforeach ()
-    if (opt_TARGET_NAME)
-        set(target_name ${opt_TARGET_NAME})
-    else ()
-        set(target_name ${framework}ForwardingHeaders)
-    endif ()
-    add_custom_target(${target_name} DEPENDS ${fwd_headers})
-    add_dependencies(${framework} ${target_name})
+    add_custom_target(${target_name} DEPENDS ${dst_files})
 endfunction()
 
 # Helper macros for debugging CMake problems.
index 5d58959..19bc1cf 100644 (file)
@@ -1,3 +1,15 @@
+2019-05-02  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
+        https://bugs.webkit.org/show_bug.cgi?id=197174
+
+        Reviewed by Alex Christensen.
+
+        Make TestJSC dependent on JavaScriptCorePrivateFrameworkHeaders.
+
+        * TestWebKitAPI/PlatformGTK.cmake:
+        * TestWebKitAPI/PlatformWPE.cmake:
+
 2019-05-02  Alex Christensen  <achristensen@webkit.org>
 
         Build fix for internal branch.
index 6aca35b..a22aea3 100644 (file)
@@ -119,6 +119,10 @@ set(TestJSC_LIBRARIES
     JavaScriptCore
 )
 
+set(TestJSC_DEPENDENCIES
+    JavaScriptCorePrivateFrameworkHeaders
+)
+
 set(TestJSC_DEFINITIONS
     WEBKIT_SRC_DIR="${CMAKE_SOURCE_DIR}"
 )
index 82749a8..74c9369 100644 (file)
@@ -117,6 +117,10 @@ set(TestJSC_LIBRARIES
     JavaScriptCore
 )
 
+set(TestJSC_DEPENDENCIES
+    JavaScriptCorePrivateFrameworkHeaders
+)
+
 set(TestJSC_DEFINITIONS
     WEBKIT_SRC_DIR="${CMAKE_SOURCE_DIR}"
 )