[CMake] WEBKIT_COMPUTE_SOURCES should use the target's derived sources directory
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2019 01:28:33 +0000 (01:28 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2019 01:28:33 +0000 (01:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196741

Reviewed by Michael Catanzaro.

WEBKIT_COMPUTE_SOURCES is using ${DERIVED_SOURCES_DIR} directly. Instead it should
rely on the directory specified by the target.

* Source/cmake/WebKitFS.cmake:
Add variables that can be expanded within CMake to the derived sources directory for
a target.

* Source/cmake/WebKitMacros.cmake:
Use variable expansion rather than ${DERIVED_SOURCES_DIR} to determine the target's
derived sources directory.

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

ChangeLog
Source/cmake/WebKitFS.cmake
Source/cmake/WebKitMacros.cmake

index ea4a919..14d0895 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
 2019-04-09  Don Olmstead  <don.olmstead@sony.com>
 
+        [CMake] WEBKIT_COMPUTE_SOURCES should use the target's derived sources directory
+        https://bugs.webkit.org/show_bug.cgi?id=196741
+
+        Reviewed by Michael Catanzaro.
+
+        WEBKIT_COMPUTE_SOURCES is using ${DERIVED_SOURCES_DIR} directly. Instead it should
+        rely on the directory specified by the target.
+
+        * Source/cmake/WebKitFS.cmake:
+        Add variables that can be expanded within CMake to the derived sources directory for
+        a target.
+
+        * Source/cmake/WebKitMacros.cmake:
+        Use variable expansion rather than ${DERIVED_SOURCES_DIR} to determine the target's
+        derived sources directory.
+
+2019-04-09  Don Olmstead  <don.olmstead@sony.com>
+
         [CMake] WTF derived sources should only be referenced inside WTF
         https://bugs.webkit.org/show_bug.cgi?id=196706
 
index eb06540..b8d948d 100644 (file)
@@ -38,7 +38,15 @@ set(DERIVED_SOURCES_WEBKITLEGACY_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebKitL
 set(DERIVED_SOURCES_WEBKIT_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebKit")
 set(DERIVED_SOURCES_WEBINSPECTORUI_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebInspectorUI")
 
+# These values will replace the above after refactoring is complete
 set(WTF_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WTF")
+set(JavaScriptCore_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore")
+set(PAL_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/PAL")
+set(WebCore_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebCore")
+set(WebDriver_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebDriver")
+set(WebKitLegacy_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebKitLegacy")
+set(WebKit_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebKit")
+set(WebInspectorUI_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebInspectorUI")
 
 set(FORWARDING_HEADERS_DIR ${DERIVED_SOURCES_DIR}/ForwardingHeaders)
 
index 3cb696f..fac9d42 100644 (file)
@@ -3,8 +3,10 @@
 # WebCore), then put it there instead.
 
 macro(WEBKIT_COMPUTE_SOURCES _framework)
+    set(_derivedSourcesPath ${${_framework}_DERIVED_SOURCES_DIR})
+
     foreach (_sourcesListFile IN LISTS ${_framework}_UNIFIED_SOURCE_LIST_FILES)
-      configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${_sourcesListFile}" "${DERIVED_SOURCES_DIR}/${_framework}/${_sourcesListFile}" COPYONLY)
+      configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${_sourcesListFile}" "${_derivedSourcesPath}/${_sourcesListFile}" COPYONLY)
       message(STATUS "Using source list file: ${_sourcesListFile}")
 
       list(APPEND _sourceListFileTruePaths "${CMAKE_CURRENT_SOURCE_DIR}/${_sourcesListFile}")
@@ -18,7 +20,7 @@ macro(WEBKIT_COMPUTE_SOURCES _framework)
 
     if (ENABLE_UNIFIED_BUILDS)
         execute_process(COMMAND ${RUBY_EXECUTABLE} ${WTF_SCRIPTS_DIR}/generate-unified-source-bundles.rb
-            "--derived-sources-path" "${DERIVED_SOURCES_DIR}/${_framework}"
+            "--derived-sources-path" "${_derivedSourcesPath}"
             "--source-tree-path" ${CMAKE_CURRENT_SOURCE_DIR}
             "--print-bundled-sources"
             "--feature-flags" "${UNIFIED_SOURCE_LIST_ENABLED_FEATURES}"
@@ -37,7 +39,7 @@ macro(WEBKIT_COMPUTE_SOURCES _framework)
         unset(_sourceFileTmp)
 
         execute_process(COMMAND ${RUBY_EXECUTABLE} ${WTF_SCRIPTS_DIR}/generate-unified-source-bundles.rb
-            "--derived-sources-path" "${DERIVED_SOURCES_DIR}/${_framework}"
+            "--derived-sources-path" "${_derivedSourcesPath}"
             "--source-tree-path" ${CMAKE_CURRENT_SOURCE_DIR}
             "--feature-flags" "${UNIFIED_SOURCE_LIST_ENABLED_FEATURES}"
             ${_sourceListFileTruePaths}
@@ -53,7 +55,7 @@ macro(WEBKIT_COMPUTE_SOURCES _framework)
         unset(_outputTmp)
     else ()
         execute_process(COMMAND ${RUBY_EXECUTABLE} ${WTF_SCRIPTS_DIR}/generate-unified-source-bundles.rb
-            "--derived-sources-path" "${DERIVED_SOURCES_DIR}/${_framework}"
+            "--derived-sources-path" "${_derivedSourcesPath}"
             "--source-tree-path" ${CMAKE_CURRENT_SOURCE_DIR}
             "--print-all-sources"
             "--feature-flags" "${UNIFIED_SOURCE_LIST_ENABLED_FEATURES}"