[CMake] Make TestWebKitAPI dependencies explicit
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Sep 2018 01:52:00 +0000 (01:52 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Sep 2018 01:52:00 +0000 (01:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189282

Reviewed by Fujii Hironori.

The config.h file includes files from JSC, WebCore and WebKit which
places a dependency on those headers even when just building TestWTF.
This makes the depedencies explicit for all CMake ports and shoud
remove any race conditions that can be encountered when building tests.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWPE.cmake:
* TestWebKitAPI/PlatformWin.cmake:

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

Tools/ChangeLog
Tools/TestWebKitAPI/CMakeLists.txt
Tools/TestWebKitAPI/PlatformGTK.cmake
Tools/TestWebKitAPI/PlatformWPE.cmake
Tools/TestWebKitAPI/PlatformWin.cmake

index 9a359a6..8459740 100644 (file)
@@ -1,3 +1,20 @@
+2018-09-04  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Make TestWebKitAPI dependencies explicit
+        https://bugs.webkit.org/show_bug.cgi?id=189282
+
+        Reviewed by Fujii Hironori.
+
+        The config.h file includes files from JSC, WebCore and WebKit which
+        places a dependency on those headers even when just building TestWTF.
+        This makes the depedencies explicit for all CMake ports and shoud
+        remove any race conditions that can be encountered when building tests.
+
+        * TestWebKitAPI/CMakeLists.txt:
+        * TestWebKitAPI/PlatformGTK.cmake:
+        * TestWebKitAPI/PlatformWPE.cmake:
+        * TestWebKitAPI/PlatformWin.cmake:
+
 2018-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Populate "text/uri-list" with multiple URLs when the pasteboard contains multiple URLs
index 968af76..9c51972 100644 (file)
@@ -14,6 +14,16 @@ set(TestWebKitAPI_LIBRARIES
     WTF${DEBUG_SUFFIX}
 )
 
+set(TestWebKitAPI_DEPENDENCIES
+    JavaScriptCoreForwardingHeaders
+    JavaScriptCorePrivateForwardingHeaders
+    WTFForwardingHeaders
+)
+
+if (ENABLE_WEBCORE)
+    list(APPEND TestWebKitAPI_DEPENDENCIES PALForwardingHeaders)
+endif ()
+
 if (ENABLE_WEBKIT)
     set(test_webkit_api_LIBRARIES
         JavaScriptCore
@@ -216,7 +226,7 @@ if (ENABLE_WEBKIT)
     )
 
     target_link_libraries(TestWebKitAPIInjectedBundle ${TestWebKitAPI_LIBRARIES})
-    add_dependencies(TestWebKitAPIInjectedBundle WTF ${ForwardingHeadersForTestWebKitAPI_NAME})
+    add_dependencies(TestWebKitAPIInjectedBundle WTF ${TestWebKitAPI_DEPENDENCIES})
 
     if (COMPILER_IS_GCC_OR_CLANG)
         WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIInjectedBundle -Wno-dangling-else
@@ -249,10 +259,11 @@ add_executable(TestWTF
 
 if (WIN32)
     add_dependencies(TestWTF TestWTFLib)
+else ()
+    add_dependencies(TestWTF WTF ${TestWebKitAPI_DEPENDENCIES})
 endif ()
 
 target_link_libraries(TestWTF ${test_wtf_LIBRARIES})
-add_dependencies(TestWTF WTF ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
 add_test(TestWTF ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF}/TestWTF)
 set_tests_properties(TestWTF PROPERTIES TIMEOUT 60)
 set_target_properties(TestWTF PROPERTIES
@@ -283,7 +294,7 @@ if (ENABLE_WEBKIT)
 
     target_link_libraries(TestWebKitAPIBase JavaScriptCore WTF WebKit gtest)
 
-    add_dependencies(TestWebKitAPIBase WebKit ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+    add_dependencies(TestWebKitAPIBase WebKit ${TestWebKitAPI_DEPENDENCIES})
 
     if (COMPILER_IS_GCC_OR_CLANG)
         WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIBase -Wno-sign-compare
index b0ed8f8..b0e268e 100644 (file)
@@ -10,7 +10,7 @@ add_custom_target(TestWebKitAPI-forwarding-headers
     DEPENDS WebKit-forwarding-headers
 )
 
-set(ForwardingHeadersForTestWebKitAPI_NAME TestWebKitAPI-forwarding-headers PALForwardingHeaders)
+list(APPEND TestWebKitAPI_DEPENDENCIES TestWebKitAPI-forwarding-headers)
 
 include_directories(
     ${FORWARDING_HEADERS_DIR}
@@ -107,7 +107,7 @@ add_executable(TestWebCore
 )
 
 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
-add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
+add_dependencies(TestWebCore ${TestWebKitAPI_DEPENDENCIES})
 
 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
@@ -125,7 +125,7 @@ target_link_libraries(TestJSC
     ${GLIB_LIBRARIES}
     JavaScriptCore
 )
-add_dependencies(TestJSC ${ForwardingHeadersForTestWebKitAPI_NAME})
+add_dependencies(TestJSC ${TestWebKitAPI_DEPENDENCIES})
 add_test(TestJSC ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore/TestJSC)
 set_tests_properties(TestJSC PROPERTIES TIMEOUT 60)
 set_target_properties(TestJSC PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore)
index 7457c75..aa1ec53 100644 (file)
@@ -10,7 +10,7 @@ add_custom_target(TestWebKitAPI-forwarding-headers
     DEPENDS webkitwpe-forwarding-headers
 )
 
-set(ForwardingHeadersForTestWebKitAPI_NAME TestWebKitAPI-forwarding-headers PALForwardingHeaders)
+list(APPEND TestWebKitAPI_DEPENDENCIES TestWebKitAPI-forwarding-headers)
 
 include_directories(
     ${FORWARDING_HEADERS_DIR}
@@ -70,7 +70,7 @@ add_executable(TestWebCore
 )
 
 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
-add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
+add_dependencies(TestWebCore ${TestWebKitAPI_DEPENDENCIES})
 
 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
@@ -98,7 +98,7 @@ target_link_libraries(TestJSC
     JavaScriptCore
 )
 add_test(TestJSC ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore/TestJSC)
-add_dependencies(TestJSC ${ForwardingHeadersForTestWebKitAPI_NAME})
+add_dependencies(TestJSC ${TestWebKitAPI_DEPENDENCIES})
 set_tests_properties(TestJSC PROPERTIES TIMEOUT 60)
 set_target_properties(TestJSC PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore)
 
index ec591ee..0e415a1 100644 (file)
@@ -99,9 +99,9 @@ if (USE_CF)
     )
 endif ()
 
-set(forwarding_headers_dependencies WebCoreForwardingHeaders PALForwardingHeaders)
+list(APPEND TestWebKitAPI_DEPENDENCIES WebCoreForwardingHeaders)
 if (ENABLE_WEBKIT)
-    list(APPEND forwarding_headers_dependencies WebKitForwardingHeaders)
+    list(APPEND TestWebKitAPI_DEPENDENCIES WebKitForwardingHeaders)
 endif ()
 
 add_library(TestWTFLib SHARED
@@ -110,7 +110,7 @@ add_library(TestWTFLib SHARED
 )
 set_target_properties(TestWTFLib PROPERTIES OUTPUT_NAME "TestWTFLib")
 target_link_libraries(TestWTFLib ${test_wtf_LIBRARIES})
-add_dependencies(TestWTFLib ${forwarding_headers_dependencies})
+add_dependencies(TestWTFLib ${TestWebKitAPI_DEPENDENCIES})
 
 set(test_wtf_LIBRARIES
     shlwapi
@@ -124,7 +124,7 @@ add_library(TestWebCoreLib SHARED
 
 target_link_libraries(TestWebCoreLib ${test_webcore_LIBRARIES})
 set_target_properties(TestWebCoreLib PROPERTIES OUTPUT_NAME "TestWebCoreLib")
-add_dependencies(TestWebCoreLib ${forwarding_headers_dependencies})
+add_dependencies(TestWebCoreLib ${TestWebKitAPI_DEPENDENCIES})
 
 if (PAL_LIBRARY_TYPE MATCHES STATIC)
     target_compile_definitions(TestWebCoreLib PRIVATE -DSTATICALLY_LINKED_WITH_PAL=1)
@@ -161,7 +161,7 @@ if (ENABLE_WEBKIT_LEGACY)
     )
 
     target_link_libraries(TestWebKitLegacyLib ${test_webkitlegacy_LIBRARIES})
-    add_dependencies(TestWebKitLegacyLib ${forwarding_headers_dependencies})
+    add_dependencies(TestWebKitLegacyLib ${TestWebKitAPI_DEPENDENCIES})
 
     add_executable(TestWebKitLegacy
         ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp