7142194188ecd23c539ef149abcaabdeb9556864
[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 add_custom_target(forwarding-headersWinForTestWebKitAPI
6     COMMAND ${CMAKE_BINARY_DIR}/DerivedSources/WebCore/preBuild.cmd VERBATIM
7 )
8 set(ForwardingHeadersForTestWebKitAPI_NAME forwarding-headersWinForTestWebKitAPI)
9
10 if (${WTF_PLATFORM_WIN_CAIRO})
11     add_definitions(-DWIN_CAIRO)
12 endif ()
13
14 set(test_main_SOURCES
15     ${TESTWEBKITAPI_DIR}/win/main.cpp
16 )
17
18 include_directories(
19     ${DERIVED_SOURCES_DIR}
20     ${FORWARDING_HEADERS_DIR}
21     ${FORWARDING_HEADERS_DIR}/JavaScriptCore
22     ${TESTWEBKITAPI_DIR}/win
23     ${DERIVED_SOURCES_DIR}/WebKit/Interfaces
24 )
25
26 add_definitions(-DWEBCORE_EXPORT=)
27
28 set(test_webcore_LIBRARIES
29     Crypt32
30     D2d1
31     Dwrite
32     dxguid
33     Iphlpapi
34     Psapi
35     Shlwapi
36     Usp10
37     WebCore${DEBUG_SUFFIX}
38     WebCoreDerivedSources${DEBUG_SUFFIX}
39     WindowsCodecs
40     gtest
41 )
42
43 set(TestWebCoreLib_SOURCES
44     ${test_main_SOURCES}
45     win/TestWebCoreStubs.cpp
46     ${TESTWEBKITAPI_DIR}/TestsController.cpp
47     ${TESTWEBKITAPI_DIR}/Tests/WebCore/AffineTransform.cpp
48     ${TESTWEBKITAPI_DIR}/Tests/WebCore/CalculationValue.cpp
49     ${TESTWEBKITAPI_DIR}/Tests/WebCore/ComplexTextController.cpp
50     ${TESTWEBKITAPI_DIR}/Tests/WebCore/CSSParser.cpp
51     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatRect.cpp
52     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatPoint.cpp
53     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatSize.cpp
54     ${TESTWEBKITAPI_DIR}/Tests/WebCore/GridPosition.cpp
55     ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
56     ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntRect.cpp
57     ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntPoint.cpp
58     ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntSize.cpp
59     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
60     ${TESTWEBKITAPI_DIR}/Tests/WebCore/MIMETypeRegistry.cpp
61     ${TESTWEBKITAPI_DIR}/Tests/WebCore/ParsedContentRange.cpp
62     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SecurityOrigin.cpp
63     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
64     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBufferTest.cpp
65     ${TESTWEBKITAPI_DIR}/Tests/WebCore/TimeRanges.cpp
66     ${TESTWEBKITAPI_DIR}/Tests/WebCore/TransformationMatrix.cpp
67     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
68     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URLParser.cpp
69     ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/DIBPixelData.cpp
70     ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/LinkedFonts.cpp
71 )
72
73 if (${WTF_PLATFORM_WIN_CAIRO})
74     list(APPEND test_webcore_LIBRARIES
75         ${CAIRO_LIBRARIES}
76         ${OPENSSL_LIBRARIES}
77         libANGLE
78         mfuuid
79         strmiids
80         vcruntime
81     )
82     list(APPEND TestWebCoreLib_SOURCES
83         ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/BitmapImage.cpp
84     )
85 else ()
86     list(APPEND test_webcore_LIBRARIES
87         ASL${DEBUG_SUFFIX}
88         CFNetwork${DEBUG_SUFFIX}
89         CoreGraphics${DEBUG_SUFFIX}
90         CoreText${DEBUG_SUFFIX}
91         QuartzCore${DEBUG_SUFFIX}
92         WebKitSystemInterface${DEBUG_SUFFIX}
93         WebKitQuartzCoreAdditions${DEBUG_SUFFIX}
94         libdispatch${DEBUG_SUFFIX}
95         libexslt${DEBUG_SUFFIX}
96         libicuin${DEBUG_SUFFIX}
97         libicuuc${DEBUG_SUFFIX}
98     )
99 endif ()
100
101 if (USE_CF)
102     list(APPEND test_webcore_LIBRARIES
103         ${COREFOUNDATION_LIBRARY}
104     )
105 endif ()
106
107 add_library(TestWTFLib SHARED
108     ${test_main_SOURCES}
109     ${TestWTF_SOURCES}
110 )
111 set_target_properties(TestWTFLib PROPERTIES OUTPUT_NAME "TestWTFLib")
112 target_link_libraries(TestWTFLib ${test_wtf_LIBRARIES})
113 add_dependencies(TestWTFLib ${ForwardingHeadersForTestWebKitAPI_NAME})
114
115 set(test_wtf_LIBRARIES
116     shlwapi
117 )
118 set(TestWTF_SOURCES
119 )
120
121 add_library(TestWebCoreLib SHARED
122     ${TestWebCoreLib_SOURCES}
123 )
124
125 target_link_libraries(TestWebCoreLib ${test_webcore_LIBRARIES})
126 set_target_properties(TestWebCoreLib PROPERTIES OUTPUT_NAME "TestWebCoreLib")
127
128 add_executable(TestWebCore
129     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
130 )
131 target_link_libraries(TestWebCore shlwapi)
132 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
133
134
135 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebCore)
136 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
137
138 if (${WTF_PLATFORM_WIN_CAIRO})
139     include_directories(
140         ${CAIRO_INCLUDE_DIRS}
141     )
142 endif ()
143
144 set(test_webkitlegacy_LIBRARIES
145     WebCoreTestSupport
146     WebKitLegacy${DEBUG_SUFFIX}
147     gtest
148 )
149 add_library(TestWebKitLegacyLib SHARED
150     ${test_main_SOURCES}
151     ${TESTWEBKITAPI_DIR}/TestsController.cpp
152     ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/win/ScaleWebView.cpp
153     ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/win/WebViewDestruction.cpp
154     ${TESTWEBKITAPI_DIR}/win/HostWindow.cpp
155 )
156
157 target_link_libraries(TestWebKitLegacyLib ${test_webkitlegacy_LIBRARIES})
158
159 add_executable(TestWebKitLegacy
160     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
161 )
162 target_link_libraries(TestWebKitLegacy shlwapi)
163 add_dependencies(TestWebKitLegacy ${ForwardingHeadersForTestWebKitAPI_NAME})
164
165 add_test(TestWebKitLegacy ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitLegacy)
166 set_tests_properties(TestWebKitLegacy PROPERTIES TIMEOUT 60)
167
168 set(test_main_SOURCES
169     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
170 )
171
172 add_dependencies(TestWebCore TestWebCoreLib)
173 add_dependencies(TestWebKitLegacy TestWebKitLegacyLib)