Build TestWebKitAPI with CMake on Windows
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Aug 2015 00:09:07 +0000 (00:09 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Aug 2015 00:09:07 +0000 (00:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147851

Reviewed by Chris Dumez.

.:

* Source/cmake/OptionsWindows.cmake:
Enable api tests and set USE_SYSTEM_MALLOC to avoid warnings when redefining it.

Source/ThirdParty:

* gtest/CMakeLists.txt:
Include DerivedSources to find WTF/WTFHeaderDetection.h.

Source/WebCore:

* PlatformWin.cmake:
Remove RenderThemeWin.cpp which is included in RenderingAllInOne.cpp.
* WebCorePrefix.h:
Include cmakeconfig.h before wtf/Platform.h like we do in JavaScriptCore's config.h to avoid warnings and redefining ENABLE_*  macros.

Source/WebKit:

* PlatformWin.cmake:
WinCairo libraries conflict with LIBCMT.lib, AppleWin libraries conflict with MSVCRT.lib,
so different /NODEFAULTLIB is needed to link WebKit.dll successfully.

Tools:

* CMakeLists.txt:
* TestWebKitAPI/CMakeLists.txt:
Removed TestJavaScriptCore because JavaScriptCore's API tests are elsewhere and this was just making an empty binary.
Surrounded WebKit2-specific features with ENABLE_WEBKIT2 checks.
Include directories after the Platform*.cmake is included because HostWindow.h needs to be found in Tools/TestWebKitAPI/win
before we look in Source/WebCore/platform, where another file named HostWindow.h exists.
* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/PlatformGTK.cmake:
Windows needs all the binaries to be in the same directory to find gtest.dll and the other dlls.
I did this without changing the directory structure of the existing EFL and GTK builds.
* TestWebKitAPI/PlatformWin.cmake: Added.
* TestWebKitAPI/win/main.cpp:
(main):
(dllLauncherEntryPoint):
Added so we can launch TestWebKitAPI executables after finding the AAS directory.
* WinLauncher/CMakeLists.txt:
AppleWin port needs /NODEFAULTLIB:MSVCRT.

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

17 files changed:
ChangeLog
Source/ThirdParty/ChangeLog
Source/ThirdParty/gtest/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/PlatformWin.cmake
Source/WebCore/WebCorePrefix.h
Source/WebKit/ChangeLog
Source/WebKit/PlatformWin.cmake
Source/cmake/OptionsWindows.cmake
Tools/CMakeLists.txt
Tools/ChangeLog
Tools/TestWebKitAPI/CMakeLists.txt
Tools/TestWebKitAPI/PlatformEfl.cmake
Tools/TestWebKitAPI/PlatformGTK.cmake
Tools/TestWebKitAPI/PlatformWin.cmake [new file with mode: 0644]
Tools/TestWebKitAPI/win/main.cpp
Tools/WinLauncher/CMakeLists.txt

index 4e2df59..718c826 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-08-10  Alex Christensen  <achristensen@webkit.org>
+
+        Build TestWebKitAPI with CMake on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=147851
+
+        Reviewed by Chris Dumez.
+
+        * Source/cmake/OptionsWindows.cmake:
+        Enable api tests and set USE_SYSTEM_MALLOC to avoid warnings when redefining it.
+
 2015-08-06  Alex Christensen  <achristensen@webkit.org>
 
         [Win] CMake build fix after r188098.
index ef5b01b..599dc26 100644 (file)
@@ -1,3 +1,13 @@
+2015-08-10  Alex Christensen  <achristensen@webkit.org>
+
+        Build TestWebKitAPI with CMake on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=147851
+
+        Reviewed by Chris Dumez.
+
+        * gtest/CMakeLists.txt:
+        Include DerivedSources to find WTF/WTFHeaderDetection.h.
+
 2015-05-26  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/21104551> Update build settings
index de23fb3..07c1dc4 100644 (file)
@@ -9,6 +9,7 @@ set(GTEST_INCLUDE_DIRECTORIES
     "${GTEST_DIR}"
     "${GTEST_DIR}/include"
     "${JAVASCRIPTCORE_DIR}"
+    "${DERIVED_SOURCES_DIR}"
     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
     "${WTF_DIR}"
 )
index 61dccee..30ffd68 100644 (file)
@@ -1,3 +1,15 @@
+2015-08-10  Alex Christensen  <achristensen@webkit.org>
+
+        Build TestWebKitAPI with CMake on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=147851
+
+        Reviewed by Chris Dumez.
+
+        * PlatformWin.cmake:
+        Remove RenderThemeWin.cpp which is included in RenderingAllInOne.cpp.
+        * WebCorePrefix.h:
+        Include cmakeconfig.h before wtf/Platform.h like we do in JavaScriptCore's config.h to avoid warnings and redefining ENABLE_*  macros.
+
 2015-08-10  Matthew Daiter  <mdaiter@apple.com>
 
         HTMLMediaElement needs way to find MediaDeviceInfo
index a679977..c43dab8 100644 (file)
@@ -120,8 +120,6 @@ list(APPEND WebCore_SOURCES
     platform/win/WheelEventWin.cpp
     platform/win/WidgetWin.cpp
     platform/win/WindowMessageBroadcaster.cpp
-
-    rendering/RenderThemeWin.cpp
 )
 
 list(APPEND WebCore_USER_AGENT_STYLE_SHEETS
index 316179d..c4ee94c 100644 (file)
 
 /* Things that need to be defined globally should go into "config.h". */
 
+#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H && defined(BUILDING_WITH_CMAKE)
+#include "cmakeconfig.h"
+#endif
+
 #include <wtf/Platform.h>
 
 #if defined(__APPLE__)
index 9e81504..dff1aee 100644 (file)
@@ -1,3 +1,14 @@
+2015-08-10  Alex Christensen  <achristensen@webkit.org>
+
+        Build TestWebKitAPI with CMake on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=147851
+
+        Reviewed by Chris Dumez.
+
+        * PlatformWin.cmake:
+        WinCairo libraries conflict with LIBCMT.lib, AppleWin libraries conflict with MSVCRT.lib,
+        so different /NODEFAULTLIB is needed to link WebKit.dll successfully.
+
 2015-08-06  Alex Christensen  <achristensen@webkit.org>
 
         [Win] Enable all Windows features in CMake
index 531afda..aa02b84 100644 (file)
@@ -444,7 +444,11 @@ string(REPLACE " " "\;" CXX_LIBS ${CMAKE_CXX_STANDARD_LIBRARIES})
 list(APPEND WebKit_LIBRARIES ${CXX_LIBS})
 set(CMAKE_CXX_STANDARD_LIBRARIES "")
 
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT")
+if (${WTF_PLATFORM_WIN_CAIRO})
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT")
+else ()
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:MSVCRT")
+endif ()
 
 # If this directory isn't created before midl runs and attempts to output WebKit.tlb,
 # It fails with an unusual error - midl failed - failed to save all changes
index 99e4f16..0ad9a67 100644 (file)
@@ -5,6 +5,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_3D_TRANSFORMS PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS PUBLIC OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_OVERFLOW_SCROLLING PUBLIC OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ALLINONE_BUILD PUBLIC ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ATTACHMENT_ELEMENT PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CANVAS_PATH PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CANVAS_PROXY PUBLIC OFF)
@@ -94,6 +95,8 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBVTT_REGIONS PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_XHR_TIMEOUT PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_XSLT PUBLIC ON)
 
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SYSTEM_MALLOC PRIVATE ON)
+
 if (${WTF_PLATFORM_WIN_CAIRO})
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ENCRYPTED_MEDIA_V2 PUBLIC OFF)
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL PUBLIC ON)
index ec6f32e..40bdc9d 100644 (file)
@@ -29,6 +29,7 @@ endif ()
 
 if (WIN32)
     add_subdirectory(DumpRenderTree)
+    add_subdirectory(TestWebKitAPI)
     add_subdirectory(WinLauncher)
 endif ()
 
index 8a79765..765b0a2 100644 (file)
@@ -1,3 +1,28 @@
+2015-08-10  Alex Christensen  <achristensen@webkit.org>
+
+        Build TestWebKitAPI with CMake on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=147851
+
+        Reviewed by Chris Dumez.
+
+        * CMakeLists.txt:
+        * TestWebKitAPI/CMakeLists.txt:
+        Removed TestJavaScriptCore because JavaScriptCore's API tests are elsewhere and this was just making an empty binary.
+        Surrounded WebKit2-specific features with ENABLE_WEBKIT2 checks.
+        Include directories after the Platform*.cmake is included because HostWindow.h needs to be found in Tools/TestWebKitAPI/win 
+        before we look in Source/WebCore/platform, where another file named HostWindow.h exists.
+        * TestWebKitAPI/PlatformEfl.cmake:
+        * TestWebKitAPI/PlatformGTK.cmake:
+        Windows needs all the binaries to be in the same directory to find gtest.dll and the other dlls.
+        I did this without changing the directory structure of the existing EFL and GTK builds.
+        * TestWebKitAPI/PlatformWin.cmake: Added.
+        * TestWebKitAPI/win/main.cpp:
+        (main):
+        (dllLauncherEntryPoint):
+        Added so we can launch TestWebKitAPI executables after finding the AAS directory.
+        * WinLauncher/CMakeLists.txt:
+        AppleWin port needs /NODEFAULTLIB:MSVCRT.
+
 2015-08-10  Dewei Zhu  <dewei_zhu@apple.com>
 
         Make cleanup more robust and minor code cleaning in run benchmark script.
index dc2513d..81f691d 100644 (file)
@@ -1,38 +1,4 @@
 set(TESTWEBKITAPI_DIR "${TOOLS_DIR}/TestWebKitAPI")
-set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitAPI")
-
-include_directories(${CMAKE_BINARY_DIR}
-    ${TESTWEBKITAPI_DIR}
-    ${CMAKE_SOURCE_DIR}/Source
-    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
-    ${DERIVED_SOURCES_WEBCORE_DIR}
-    ${JAVASCRIPTCORE_DIR}
-    ${JAVASCRIPTCORE_DIR}/API
-    ${JAVASCRIPTCORE_DIR}/ForwardingHeaders
-    ${THIRDPARTY_DIR}/gtest/include
-    ${WEBCORE_DIR}/css
-    ${WEBCORE_DIR}/dom
-    ${WEBCORE_DIR}/editing
-    ${WEBCORE_DIR}/loader/cache
-    ${WEBCORE_DIR}/platform
-    ${WEBCORE_DIR}/platform/animation
-    ${WEBCORE_DIR}/platform/graphics
-    ${WEBCORE_DIR}/platform/text
-    ${WEBCORE_DIR}/platform/network
-    ${WEBCORE_DIR}/platform/network/soup
-    ${WEBCORE_DIR}/rendering/style
-    ${WEBKIT2_DIR}/Platform/IPC
-    ${WEBKIT2_DIR}/Shared
-    ${WEBKIT2_DIR}/Shared/API
-    ${WEBKIT2_DIR}/Shared/API/c
-    ${WEBKIT2_DIR}/Shared/Plugins
-    ${WEBKIT2_DIR}/UIProcess
-    ${WEBKIT2_DIR}/UIProcess/API
-    ${WEBKIT2_DIR}/WebProcess/InjectedBundle
-    ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/c
-    ${WTF_DIR}
-)
-
 set(test_wtf_LIBRARIES
     WTF
     gtest
@@ -44,19 +10,28 @@ set(test_webcore_LIBRARIES
     gtest
 )
 
-set(test_webkit2_api_LIBRARIES
-    JavaScriptCore
-    TestWebKitAPIBase
-    WTF
-    WebKit2
-    gtest
-)
-
 set(TestWebKitAPI_LIBRARIES
     WTF
-    WebKit2
 )
 
+if (ENABLE_WEBKIT2)
+    set(test_webkit2_api_LIBRARIES
+        JavaScriptCore
+        TestWebKitAPIBase
+        WTF
+        WebKit2
+        gtest
+    )
+    list(APPEND TestWebKitAPI_LIBRARIES
+        WebKit2
+    )
+else ()
+    list(APPEND TestWebKitAPI_LIBRARIES
+        WebKit
+    )
+endif ()
+
+
 set(TestJavaScriptCore_LIBRARIES
     JavaScriptCore
     gtest
@@ -99,40 +74,75 @@ set(TestWTF_SOURCES
 
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
-add_library(TestWebKitAPIInjectedBundle SHARED
-    ${bundle_harness_SOURCES}
-    ${TESTWEBKITAPI_DIR}/InjectedBundleController.cpp
-    ${TESTWEBKITAPI_DIR}/InjectedBundleMain.cpp
-    ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/TextFieldDidBeginAndEndEditing_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillLoad_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp
+include_directories(
+    ${TESTWEBKITAPI_DIR}
+    ${CMAKE_BINARY_DIR}
+    ${CMAKE_SOURCE_DIR}/Source
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
+    ${DERIVED_SOURCES_WEBCORE_DIR}
+    ${JAVASCRIPTCORE_DIR}
+    ${JAVASCRIPTCORE_DIR}/API
+    ${JAVASCRIPTCORE_DIR}/ForwardingHeaders
+    ${THIRDPARTY_DIR}/gtest/include
+    ${WEBCORE_DIR}/css
+    ${WEBCORE_DIR}/dom
+    ${WEBCORE_DIR}/editing
+    ${WEBCORE_DIR}/loader/cache
+    ${WEBCORE_DIR}/platform
+    ${WEBCORE_DIR}/platform/animation
+    ${WEBCORE_DIR}/platform/graphics
+    ${WEBCORE_DIR}/platform/text
+    ${WEBCORE_DIR}/platform/network
+    ${WEBCORE_DIR}/platform/network/soup
+    ${WEBCORE_DIR}/rendering/style
+    ${WEBKIT2_DIR}/Platform/IPC
+    ${WEBKIT2_DIR}/Shared
+    ${WEBKIT2_DIR}/Shared/API
+    ${WEBKIT2_DIR}/Shared/API/c
+    ${WEBKIT2_DIR}/Shared/Plugins
+    ${WEBKIT2_DIR}/UIProcess
+    ${WEBKIT2_DIR}/UIProcess/API
+    ${WEBKIT2_DIR}/WebProcess/InjectedBundle
+    ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/c
+    ${WTF_DIR}
 )
 
-target_link_libraries(TestWebKitAPIInjectedBundle ${TestWebKitAPI_LIBRARIES})
-add_dependencies(TestWebKitAPIInjectedBundle ${ForwardingHeadersForTestWebKitAPI_NAME})
+if (ENABLE_WEBKIT2)
+    add_library(TestWebKitAPIInjectedBundle SHARED
+        ${bundle_harness_SOURCES}
+        ${TESTWEBKITAPI_DIR}/InjectedBundleController.cpp
+        ${TESTWEBKITAPI_DIR}/InjectedBundleMain.cpp
+        ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/TextFieldDidBeginAndEndEditing_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillLoad_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp
+    )
+
+    target_link_libraries(TestWebKitAPIInjectedBundle ${TestWebKitAPI_LIBRARIES})
+    add_dependencies(TestWebKitAPIInjectedBundle ${ForwardingHeadersForTestWebKitAPI_NAME})
 
-get_property(TestWebKitAPIInjectedBundle_PATH TARGET TestWebKitAPIInjectedBundle PROPERTY LOCATION)
+    get_property(TestWebKitAPIInjectedBundle_PATH TARGET TestWebKitAPIInjectedBundle PROPERTY LOCATION)
+endif ()
 
 add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DGTEST_HAS_RTTI=0
     -DTEST_WEBKIT2_RESOURCES_DIR=\"${TESTWEBKITAPI_DIR}/Tests/WebKit2\"
@@ -151,27 +161,14 @@ add_executable(TestWTF
 )
 
 target_link_libraries(TestWTF ${test_wtf_LIBRARIES})
-add_dependencies(TestWTF ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
-add_test(TestWTF ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WTF/TestWTF)
+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
-        RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WTF
-    )
-
-
-add_executable(TestJavaScriptCore
-    ${test_main_SOURCES}
-    ${TESTWEBKITAPI_DIR}/TestsController.cpp
+set_target_properties(TestWTF PROPERTIES
+    RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF}
 )
 
-target_link_libraries(TestJavaScriptCore ${TestJavaScriptCore_LIBRARIES})
-add_dependencies(TestJavaScriptCore ${ForwardingHeadersForTestWebKitAPI_NAME})
-
-add_test(TestJavaScriptCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore/TestJavaScriptCore)
-set_tests_properties(TestJavaScriptCore PROPERTIES TIMEOUT 60)
-set_target_properties(TestJavaScriptCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore)
-add_dependencies(TestJavaScriptCore JavaScriptCore ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
-
+# FIXME: EFL is the only port that separates the WebCore binaries. Each port ought to do closer to the same thing.
 foreach (testName ${test_webcore_BINARIES})
     add_executable(${testName} ${test_main_SOURCES} ${TESTWEBKITAPI_DIR}/TestsController.cpp ${TESTWEBKITAPI_DIR}/Tests/WebCore/${testName}.cpp)
     add_test(${testName} ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/${testName})
@@ -182,34 +179,36 @@ foreach (testName ${test_webcore_BINARIES})
     )
 endforeach ()
 
-add_library(TestWebKitAPIBase
-    ${test_main_SOURCES}
-    ${webkit2_api_harness_SOURCES}
-    ${TESTWEBKITAPI_DIR}/JavaScriptTest.cpp
-    ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
-    ${TESTWEBKITAPI_DIR}/TestsController.cpp
-)
-
-add_dependencies(TestWebKitAPIBase WebKit2 ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
-
-foreach (testName ${test_webkit2_api_BINARIES})
-    get_filename_component(testBaseName ${testName} NAME)
-    add_executable(${testBaseName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
-    add_test(${testBaseName} ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/${testBaseName})
-    set_tests_properties(${testBaseName} PROPERTIES TIMEOUT 60)
-    target_link_libraries(${testBaseName} ${test_webkit2_api_LIBRARIES})
-    set_target_properties(${testBaseName} PROPERTIES
-        RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2
+if (ENABLE_WEBKIT2)
+    add_library(TestWebKitAPIBase
+        ${test_main_SOURCES}
+        ${webkit2_api_harness_SOURCES}
+        ${TESTWEBKITAPI_DIR}/JavaScriptTest.cpp
+        ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
+        ${TESTWEBKITAPI_DIR}/TestsController.cpp
     )
-endforeach ()
 
-# We don't run tests that are expected to fail. We could use the WILL_FAIL
-# property, but it reports failure when the test crashes or timeouts and would
-# make the bot red.
-foreach (testName ${test_webkit2_api_fail_BINARIES})
-    add_executable(${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
-    target_link_libraries(${testName} ${test_webkit2_api_LIBRARIES})
-    set_target_properties(${testName} PROPERTIES
-        RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/failure
-    )
-endforeach ()
+    add_dependencies(TestWebKitAPIBase WebKit2 ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+
+    foreach (testName ${test_webkit2_api_BINARIES})
+        get_filename_component(testBaseName ${testName} NAME)
+        add_executable(${testBaseName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
+        add_test(${testBaseName} ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/${testBaseName})
+        set_tests_properties(${testBaseName} PROPERTIES TIMEOUT 60)
+        target_link_libraries(${testBaseName} ${test_webkit2_api_LIBRARIES})
+        set_target_properties(${testBaseName} PROPERTIES
+            RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2
+        )
+    endforeach ()
+
+    # We don't run tests that are expected to fail. We could use the WILL_FAIL
+    # property, but it reports failure when the test crashes or timeouts and would
+    # make the bot red.
+    foreach (testName ${test_webkit2_api_fail_BINARIES})
+        add_executable(${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
+        target_link_libraries(${testName} ${test_webkit2_api_LIBRARIES})
+        set_target_properties(${testName} PROPERTIES
+            RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/failure
+        )
+    endforeach ()
+endif ()
index dabdbce..92c2073 100644 (file)
@@ -1,3 +1,6 @@
+set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitAPI")
+set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF "${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WTF")
+
 add_custom_target(forwarding-headersEflForTestWebKitAPI
     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${TESTWEBKITAPI_DIR} --output ${DERIVED_SOURCES_WEBKIT2_DIR}/include --platform efl --platform CoordinatedGraphics --platform soup
     DEPENDS forwarding-headersEflForWebKit2
index 1fc4a73..8e5c4af 100644 (file)
@@ -1,3 +1,6 @@
+set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitAPI")
+set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF "${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WTF")
+
 # This is necessary because it is possible to build TestWebKitAPI with WebKit2
 # disabled and this triggers the inclusion of the WebKit2 headers.
 add_definitions(-DBUILDING_WEBKIT2__)
diff --git a/Tools/TestWebKitAPI/PlatformWin.cmake b/Tools/TestWebKitAPI/PlatformWin.cmake
new file mode 100644 (file)
index 0000000..392c3ed
--- /dev/null
@@ -0,0 +1,96 @@
+set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
+set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF "${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}")
+add_definitions(-DUSE_CONSOLE_ENTRY_POINT)
+
+set(test_main_SOURCES
+    ${TESTWEBKITAPI_DIR}/win/main.cpp
+)
+
+include_directories(
+    ${DERIVED_SOURCES_DIR}
+    ${DERIVED_SOURCES_DIR}/ForwardingHeaders
+    ${TESTWEBKITAPI_DIR}/win
+)
+
+add_definitions(-DWEBCORE_EXPORT=)
+
+set(test_webcore_LIBRARIES
+    Crypt32
+    Iphlpapi
+    Shlwapi
+    Usp10
+    WebCore
+    WebKit
+    gtest
+)
+
+if (${WTF_PLATFORM_WIN_CAIRO})
+    list(APPEND test_webcore_LIBRARIES
+        cairo
+        curl
+    )
+else ()
+    list(APPEND test_webcore_LIBRARIES
+        CFNetwork
+        CoreMedia
+        WebKitSystemInterface
+    )
+endif ()
+
+add_library(TestWTFLib SHARED
+    ${test_main_SOURCES}
+    ${TestWTF_SOURCES}
+)
+set_target_properties(TestWTFLib PROPERTIES OUTPUT_NAME "TestWTF")
+target_link_libraries(TestWTFLib ${test_wtf_LIBRARIES})
+
+set(test_wtf_LIBRARIES
+    shlwapi
+)
+set(TestWTF_SOURCES
+)
+
+add_library(TestWebCoreLib SHARED
+    ${test_main_SOURCES}
+    ${TESTWEBKITAPI_DIR}/TestsController.cpp
+    ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/BitmapImage.cpp
+    ${TESTWEBKITAPI_DIR}/Tests/WebCore/CalculationValue.cpp
+    ${TESTWEBKITAPI_DIR}/Tests/WebCore/CSSParser.cpp
+    ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
+    ${TESTWEBKITAPI_DIR}/Tests/WebCore/TimeRanges.cpp
+    ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
+)
+
+target_link_libraries(TestWebCoreLib ${test_webcore_LIBRARIES})
+set_target_properties(TestWebCoreLib PROPERTIES OUTPUT_NAME "TestWebCore")
+
+add_executable(TestWebCore
+    ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
+)
+target_link_libraries(TestWebCore shlwapi)
+
+
+add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebCore)
+set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
+
+add_library(TestWebKitLib SHARED
+    ${test_main_SOURCES}
+    ${TESTWEBKITAPI_DIR}/TestsController.cpp
+    ${TESTWEBKITAPI_DIR}/Tests/WebKit/win/WebViewDestruction.cpp
+    ${TESTWEBKITAPI_DIR}/win/HostWindow.cpp
+)
+
+target_link_libraries(TestWebKitLib ${test_webcore_LIBRARIES})
+set_target_properties(TestWebKitLib PROPERTIES OUTPUT_NAME "TestWebKit")
+
+add_executable(TestWebKit
+    ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
+)
+target_link_libraries(TestWebKit shlwapi)
+
+add_test(TestWebKit ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebKit)
+set_tests_properties(TestWebKit PROPERTIES TIMEOUT 60)
+
+set(test_main_SOURCES
+    ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
+)
index eee8db9..eaa5c16 100644 (file)
@@ -63,3 +63,8 @@ int main(int argc, char** argv)
 
     return passed ? EXIT_SUCCESS : EXIT_FAILURE;
 }
+
+extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(int argc, char** argv)
+{
+    return main(argc, argv);
+}
index cd627ae..43d9ba7 100644 (file)
@@ -40,6 +40,7 @@ if (WTF_PLATFORM_WIN_CAIRO)
         CFLite
     )
 else ()
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:MSVCRT")
     list(APPEND WinLauncher_LIBRARIES
         CoreFoundation
     )