Unreviewed, fix build failure
[WebKit-https.git] / Tools / TestWebKitAPI / PlatformWin.cmake
1 set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
2 set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF "${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}")
3 add_definitions(-DUSE_CONSOLE_ENTRY_POINT)
4
5 if (${WTF_PLATFORM_WIN_CAIRO})
6     add_definitions(-DWIN_CAIRO)
7 endif ()
8
9 set(test_main_SOURCES
10     ${TESTWEBKITAPI_DIR}/win/main.cpp
11 )
12
13 include_directories(
14     ${DERIVED_SOURCES_DIR}
15     ${FORWARDING_HEADERS_DIR}
16     ${FORWARDING_HEADERS_DIR}/JavaScriptCore
17     ${TESTWEBKITAPI_DIR}/win
18     ${DERIVED_SOURCES_DIR}/WebKit/Interfaces
19     ${WTF_FRAMEWORK_HEADERS_DIR}
20     ${JavaScriptCore_FRAMEWORK_HEADERS_DIR}
21     ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS_DIR}
22     ${PAL_FRAMEWORK_HEADERS_DIR}
23     ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}
24     ${WebKitLegacy_FRAMEWORK_HEADERS_DIR}
25     ${WebKit_FRAMEWORK_HEADERS_DIR}
26     ${WebKit_PRIVATE_FRAMEWORK_HEADERS_DIR}
27 )
28
29 add_definitions(-DWEBCORE_EXPORT= -DWEBCORE_TESTSUPPORT_EXPORT=)
30
31 set(test_webcore_LIBRARIES
32     Crypt32
33     D2d1
34     Dwrite
35     dxguid
36     Iphlpapi
37     Psapi
38     Shlwapi
39     Usp10
40     WebCore${DEBUG_SUFFIX}
41     WindowsCodecs
42     gtest
43 )
44
45 set(TestWebCoreLib_SOURCES
46     ${test_main_SOURCES}
47     win/TestWebCoreStubs.cpp
48     ${TESTWEBKITAPI_DIR}/TestsController.cpp
49     ${TESTWEBKITAPI_DIR}/Tests/WebCore/AffineTransform.cpp
50     ${TESTWEBKITAPI_DIR}/Tests/WebCore/CalculationValue.cpp
51     ${TESTWEBKITAPI_DIR}/Tests/WebCore/ComplexTextController.cpp
52     ${TESTWEBKITAPI_DIR}/Tests/WebCore/CSSParser.cpp
53     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatRect.cpp
54     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatPoint.cpp
55     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatSize.cpp
56     ${TESTWEBKITAPI_DIR}/Tests/WebCore/GridPosition.cpp
57     ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
58     ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntRect.cpp
59     ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntPoint.cpp
60     ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntSize.cpp
61     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
62     ${TESTWEBKITAPI_DIR}/Tests/WebCore/MIMETypeRegistry.cpp
63     ${TESTWEBKITAPI_DIR}/Tests/WebCore/ParsedContentRange.cpp
64     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SecurityOrigin.cpp
65     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
66     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBufferTest.cpp
67     ${TESTWEBKITAPI_DIR}/Tests/WebCore/TimeRanges.cpp
68     ${TESTWEBKITAPI_DIR}/Tests/WebCore/TransformationMatrix.cpp
69     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URLParserTextEncoding.cpp
70     ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/DIBPixelData.cpp
71     ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/LinkedFonts.cpp
72 )
73
74 if (${WTF_PLATFORM_WIN_CAIRO})
75     list(APPEND test_webcore_LIBRARIES
76         ${CAIRO_LIBRARIES}
77         ${OPENSSL_LIBRARIES}
78         libANGLE
79         mfuuid
80         strmiids
81         vcruntime
82     )
83     list(APPEND TestWebCoreLib_SOURCES
84         ${TESTWEBKITAPI_DIR}/Tests/WebCore/curl/Cookies.cpp
85         ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/BitmapImage.cpp
86         ${TESTWEBKITAPI_DIR}/Tests/WebCore/CryptoDigest.cpp
87         ${TESTWEBKITAPI_DIR}/Tests/WebCore/PublicSuffix.cpp
88     )
89 else ()
90     list(APPEND test_webcore_LIBRARIES
91         ASL${DEBUG_SUFFIX}
92         CFNetwork${DEBUG_SUFFIX}
93         CoreGraphics${DEBUG_SUFFIX}
94         CoreText${DEBUG_SUFFIX}
95         QuartzCore${DEBUG_SUFFIX}
96         WebKitQuartzCoreAdditions${DEBUG_SUFFIX}
97         libdispatch${DEBUG_SUFFIX}
98         libexslt${DEBUG_SUFFIX}
99         libicuin${DEBUG_SUFFIX}
100         libicuuc${DEBUG_SUFFIX}
101     )
102 endif ()
103
104 if (USE_CF)
105     list(APPEND test_webcore_LIBRARIES
106         ${COREFOUNDATION_LIBRARY}
107     )
108 endif ()
109
110 list(APPEND TestWebKitAPI_DEPENDENCIES WebCorePrivateFrameworkHeaders)
111 if (ENABLE_WEBKIT)
112     list(APPEND TestWebKitAPI_DEPENDENCIES WebKitFrameworkHeaders)
113 endif ()
114
115 add_library(TestWTFLib SHARED
116     ${test_main_SOURCES}
117     ${TestWTF_SOURCES}
118     ${TESTWEBKITAPI_DIR}/win/UtilitiesWin.cpp
119 )
120 set_target_properties(TestWTFLib PROPERTIES OUTPUT_NAME "TestWTFLib")
121 target_link_libraries(TestWTFLib ${test_wtf_LIBRARIES})
122 add_dependencies(TestWTFLib ${TestWebKitAPI_DEPENDENCIES})
123
124 set(test_wtf_LIBRARIES
125     shlwapi
126 )
127 set(TestWTF_SOURCES
128 )
129
130 add_library(TestWebCoreLib SHARED
131     ${TestWebCoreLib_SOURCES}
132 )
133
134 target_link_libraries(TestWebCoreLib ${test_webcore_LIBRARIES})
135 set_target_properties(TestWebCoreLib PROPERTIES OUTPUT_NAME "TestWebCoreLib")
136 add_dependencies(TestWebCoreLib ${TestWebKitAPI_DEPENDENCIES})
137
138 if (PAL_LIBRARY_TYPE MATCHES STATIC)
139     target_compile_definitions(TestWebCoreLib PRIVATE -DSTATICALLY_LINKED_WITH_PAL=1)
140 endif ()
141
142 add_executable(TestWebCore
143     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
144 )
145 target_link_libraries(TestWebCore shlwapi)
146
147
148 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebCore)
149 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
150
151 if (${WTF_PLATFORM_WIN_CAIRO})
152     include_directories(
153         ${CAIRO_INCLUDE_DIRS}
154     )
155 endif ()
156
157 set(test_webkitlegacy_LIBRARIES
158     WebCoreTestSupport
159     WebKitLegacy${DEBUG_SUFFIX}
160     gtest
161 )
162
163 if (ENABLE_WEBKIT_LEGACY)
164     add_library(TestWebKitLegacyLib SHARED
165         ${test_main_SOURCES}
166         ${TESTWEBKITAPI_DIR}/TestsController.cpp
167         ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/win/ScaleWebView.cpp
168         ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/win/WebViewDestruction.cpp
169         ${TESTWEBKITAPI_DIR}/win/HostWindow.cpp
170     )
171
172     target_link_libraries(TestWebKitLegacyLib ${test_webkitlegacy_LIBRARIES})
173     add_dependencies(TestWebKitLegacyLib ${TestWebKitAPI_DEPENDENCIES})
174
175     add_executable(TestWebKitLegacy
176         ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
177     )
178     target_link_libraries(TestWebKitLegacy shlwapi)
179
180     add_test(TestWebKitLegacy ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitLegacy)
181     set_tests_properties(TestWebKitLegacy PROPERTIES TIMEOUT 60)
182
183     add_dependencies(TestWebKitLegacy TestWebKitLegacyLib)
184 endif ()
185
186 if (ENABLE_WEBKIT)
187     set(bundle_harness_SOURCES
188         ${TESTWEBKITAPI_DIR}/win/UtilitiesWin.cpp
189         ${TESTWEBKITAPI_DIR}/win/InjectedBundleControllerWin.cpp
190         ${TESTWEBKITAPI_DIR}/win/PlatformUtilitiesWin.cpp
191     )
192
193     set(webkit_api_harness_SOURCES
194         ${TESTWEBKITAPI_DIR}/win/PlatformUtilitiesWin.cpp
195         ${TESTWEBKITAPI_DIR}/win/PlatformWebViewWin.cpp
196         ${TESTWEBKITAPI_DIR}/win/UtilitiesWin.cpp
197     )
198
199     if (${WTF_PLATFORM_WIN_CAIRO})
200         list(APPEND test_webkit_api_SOURCES
201             ${TESTWEBKITAPI_DIR}/Tests/WebKit/curl/Certificates.cpp
202         )
203     endif ()
204
205     add_library(TestWebKitLib SHARED
206         ${TESTWEBKITAPI_DIR}/win/main.cpp
207         ${test_webkit_api_SOURCES}
208     )
209
210     target_link_libraries(TestWebKitLib ${test_webkit_api_LIBRARIES})
211
212     add_executable(TestWebKit
213         ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
214     )
215     target_link_libraries(TestWebKit shlwapi)
216
217     add_test(TestWebKit ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit/TestWebKit)
218     set_tests_properties(TestWebKit PROPERTIES TIMEOUT 60)
219     set_target_properties(TestWebKit PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit)
220
221     add_dependencies(TestWebKit TestWebKitAPIBase)
222 endif ()
223
224 set(test_main_SOURCES
225     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
226 )
227
228 add_dependencies(TestWebCore TestWebCoreLib)