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