[EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times
[WebKit-https.git] / Tools / TestWebKitAPI / PlatformGTK.cmake
1 # This is necessary because it is possible to build TestWebKitAPI with WebKit2
2 # disabled and this triggers the inclusion of the WebKit2 headers.
3 add_definitions(-DBUILDING_WEBKIT2__)
4
5 set(ForwardingHeadersForTestWebKitAPI_NAME TestWebKitAPI-forwarding-headers)
6
7 include_directories(
8     ${FORWARDING_HEADERS_DIR}
9     ${WEBKIT2_DIR}/UIProcess/API/C/soup
10     ${WEBKIT2_DIR}/UIProcess/API/C/gtk
11     ${WEBKIT2_DIR}/UIProcess/API/gtk
12     ${GDK3_INCLUDE_DIRS}
13     ${GLIB_INCLUDE_DIRS}
14     ${GTK3_INCLUDE_DIRS}
15     ${LIBSOUP_INCLUDE_DIRS}
16 )
17 set(test_main_SOURCES
18     ${TESTWEBKITAPI_DIR}/gtk/main.cpp
19 )
20
21 set(bundle_harness_SOURCES
22     ${TESTWEBKITAPI_DIR}/gtk/InjectedBundleControllerGtk.cpp
23     ${TESTWEBKITAPI_DIR}/gtk/PlatformUtilitiesGtk.cpp
24 )
25
26 set(webkit2_api_harness_SOURCES
27     ${TESTWEBKITAPI_DIR}/gtk/PlatformUtilitiesGtk.cpp
28     ${TESTWEBKITAPI_DIR}/gtk/PlatformWebViewGtk.cpp
29 )
30
31 list(APPEND test_wtf_LIBRARIES
32     ${GDK3_LIBRARIES}
33     ${GTK3_LIBRARIES}
34 )
35
36 list(APPEND test_webkit2_api_LIBRARIES
37     ${GDK3_LIBRARIES}
38     ${GTK3_LIBRARIES}
39 )
40
41 list(APPEND test_webcore_LIBRARIES
42     WebCorePlatformGTK
43     ${GDK3_LIBRARIES}
44     ${GTK3_LIBRARIES}
45 )
46
47 list(APPEND TestWebKitAPI_LIBRARIES
48     ${GDK3_LIBRARIES}
49     ${GTK3_LIBRARIES}
50 )
51
52 list(APPEND TestJavaScriptCore_LIBRARIES
53     ${GDK3_LIBRARIES}
54     ${GTK3_LIBRARIES}
55 )
56
57 add_executable(TestWebKit2
58     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/AboutBlankLoad.cpp
59     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest.cpp
60     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CookieManager.cpp
61     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp
62     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic.cpp
63     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache.cpp
64     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DownloadDecideDestinationCrash.cpp
65     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/EvaluateJavaScript.cpp
66     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FailedLoad.cpp
67     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/Find.cpp
68     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ForceRepaint.cpp
69     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FrameMIMETypeHTML.cpp
70     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FrameMIMETypePNG.cpp
71     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/Geolocation.cpp
72     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback.cpp
73     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle.cpp
74     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic.cpp
75     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleFrameHitTest.cpp
76     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins.cpp
77     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp
78     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp
79     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadPageOnCrash.cpp
80     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash.cpp
81     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp
82     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp
83     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp
84     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp
85     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PageLoadBasic.cpp
86     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp
87     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame.cpp
88     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PreventEmptyUserAgent.cpp
89     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp
90     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ReloadPageAfterCrash.cpp
91     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResizeWindowAfterCrash.cpp
92     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp
93     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp
94     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMedia.cpp
95     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage.cpp
96     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent.cpp
97     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPageGetScaleFactorNotZero.cpp
98     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPreferences.cpp
99     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKString.cpp
100     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKStringJSString.cpp
101     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKURL.cpp
102     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/gtk/InputMethodFilter.cpp
103 )
104
105 target_link_libraries(TestWebKit2 ${test_webkit2_api_LIBRARIES})
106 add_test(TestWebKit2 ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/TestWebKit2)
107 set_tests_properties(TestWebKit2 PROPERTIES TIMEOUT 60)
108 set_target_properties(TestWebKit2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2)
109
110 set(TestWebCoreGtk_SOURCES
111     ${TESTWEBKITAPI_DIR}/Tests/WebCore/gtk/UserAgentQuirks.cpp
112 )
113
114 add_executable(TestWebCore
115     ${test_main_SOURCES}
116     ${TestWebCoreGtk_SOURCES}
117     ${TESTWEBKITAPI_DIR}/TestsController.cpp
118     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
119     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
120 )
121
122 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
123 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
124
125 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
126 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
127 set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
128
129 list(APPEND TestWTF_SOURCES
130     ${TESTWEBKITAPI_DIR}/Tests/WTF/gobject/GMainLoopSource.cpp
131     ${TESTWEBKITAPI_DIR}/Tests/WTF/gobject/GUniquePtr.cpp
132 )
133
134 file(GLOB_RECURSE TestWebKitAPI_SOURCES
135     *.cpp
136     *.h
137 )
138
139 add_custom_command(
140     OUTPUT ${CMAKE_BINARY_DIR}/TestWebKitAPI-forwarding-headers.stamp
141     DEPENDS ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl
142             ${TestWebKitAPI_SOURCES}
143     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${TESTWEBKITAPI_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk
144     COMMAND touch ${CMAKE_BINARY_DIR}/TestWebKitAPI-forwarding-headers.stamp
145 )
146 add_custom_target(TestWebKitAPI-forwarding-headers
147     DEPENDS WebKit2-forwarding-headers
148     DEPENDS ${CMAKE_BINARY_DIR}/TestWebKitAPI-forwarding-headers.stamp
149 )