498a88dd2be76496a6ad6ba8e3ab56445f44e23e
[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         libANGLE
77         libeay32
78         mfuuid
79         ssleay32
80         strmiids
81         vcruntime
82     )
83     list(APPEND TestWebCoreLib_SOURCES
84         ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/BitmapImage.cpp
85     )
86 else ()
87     list(APPEND test_webcore_LIBRARIES
88         ASL${DEBUG_SUFFIX}
89         CFNetwork${DEBUG_SUFFIX}
90         CoreGraphics${DEBUG_SUFFIX}
91         CoreText${DEBUG_SUFFIX}
92         QuartzCore${DEBUG_SUFFIX}
93         WebKitSystemInterface${DEBUG_SUFFIX}
94         WebKitQuartzCoreAdditions${DEBUG_SUFFIX}
95         libdispatch${DEBUG_SUFFIX}
96         libexslt${DEBUG_SUFFIX}
97         libicuin${DEBUG_SUFFIX}
98         libicuuc${DEBUG_SUFFIX}
99     )
100 endif ()
101
102 if (USE_CF)
103     list(APPEND test_webcore_LIBRARIES
104         ${COREFOUNDATION_LIBRARY}
105     )
106 endif ()
107
108 add_library(TestWTFLib SHARED
109     ${test_main_SOURCES}
110     ${TestWTF_SOURCES}
111 )
112 set_target_properties(TestWTFLib PROPERTIES OUTPUT_NAME "TestWTFLib")
113 target_link_libraries(TestWTFLib ${test_wtf_LIBRARIES})
114 add_dependencies(TestWTFLib ${ForwardingHeadersForTestWebKitAPI_NAME})
115
116 set(test_wtf_LIBRARIES
117     shlwapi
118 )
119 set(TestWTF_SOURCES
120 )
121
122 add_library(TestWebCoreLib SHARED
123     ${TestWebCoreLib_SOURCES}
124 )
125
126 target_link_libraries(TestWebCoreLib ${test_webcore_LIBRARIES})
127 set_target_properties(TestWebCoreLib PROPERTIES OUTPUT_NAME "TestWebCoreLib")
128
129 add_executable(TestWebCore
130     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
131 )
132 target_link_libraries(TestWebCore shlwapi)
133 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
134
135
136 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebCore)
137 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
138
139 if (${WTF_PLATFORM_WIN_CAIRO})
140     include_directories(
141         ${CAIRO_INCLUDE_DIRS}
142     )
143 endif ()
144
145 set(test_webkitlegacy_LIBRARIES
146     WebCoreTestSupport
147     WebKitLegacy${DEBUG_SUFFIX}
148     gtest
149 )
150 add_library(TestWebKitLegacyLib SHARED
151     ${test_main_SOURCES}
152     ${TESTWEBKITAPI_DIR}/TestsController.cpp
153     ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/win/ScaleWebView.cpp
154     ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/win/WebViewDestruction.cpp
155     ${TESTWEBKITAPI_DIR}/win/HostWindow.cpp
156 )
157
158 target_link_libraries(TestWebKitLegacyLib ${test_webkitlegacy_LIBRARIES})
159
160 add_executable(TestWebKitLegacy
161     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
162 )
163 target_link_libraries(TestWebKitLegacy shlwapi)
164 add_dependencies(TestWebKitLegacy ${ForwardingHeadersForTestWebKitAPI_NAME})
165
166 add_test(TestWebKitLegacy ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitLegacy)
167 set_tests_properties(TestWebKitLegacy PROPERTIES TIMEOUT 60)
168
169 set(test_main_SOURCES
170     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
171 )
172
173 add_dependencies(TestWebCore TestWebCoreLib)
174 add_dependencies(TestWebKitLegacy TestWebKitLegacyLib)