dbcfccd260a32175f8581d56d97160f2063c616b
[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/ParsedContentRange.cpp
61     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SecurityOrigin.cpp
62     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
63     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBufferTest.cpp
64     ${TESTWEBKITAPI_DIR}/Tests/WebCore/TimeRanges.cpp
65     ${TESTWEBKITAPI_DIR}/Tests/WebCore/TransformationMatrix.cpp
66     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
67     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URLParser.cpp
68     ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/DIBPixelData.cpp
69     ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/LinkedFonts.cpp
70 )
71
72 if (${WTF_PLATFORM_WIN_CAIRO})
73     list(APPEND test_webcore_LIBRARIES
74         ${CAIRO_LIBRARIES}
75         libANGLE
76         libeay32
77         mfuuid
78         ssleay32
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         CoreFoundation${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         zdll${DEBUG_SUFFIX}
100     )
101 endif ()
102
103 add_library(TestWTFLib SHARED
104     ${test_main_SOURCES}
105     ${TestWTF_SOURCES}
106 )
107 set_target_properties(TestWTFLib PROPERTIES OUTPUT_NAME "TestWTFLib")
108 target_link_libraries(TestWTFLib ${test_wtf_LIBRARIES})
109 add_dependencies(TestWTFLib ${ForwardingHeadersForTestWebKitAPI_NAME})
110
111 set(test_wtf_LIBRARIES
112     shlwapi
113 )
114 set(TestWTF_SOURCES
115 )
116
117 add_library(TestWebCoreLib SHARED
118     ${TestWebCoreLib_SOURCES}
119 )
120
121 target_link_libraries(TestWebCoreLib ${test_webcore_LIBRARIES})
122 set_target_properties(TestWebCoreLib PROPERTIES OUTPUT_NAME "TestWebCoreLib")
123
124 add_executable(TestWebCore
125     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
126 )
127 target_link_libraries(TestWebCore shlwapi)
128 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
129
130
131 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebCore)
132 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
133
134 if (${WTF_PLATFORM_WIN_CAIRO})
135     include_directories(
136         ${CAIRO_INCLUDE_DIRS}
137     )
138 endif ()
139
140 set(test_webkit_LIBRARIES
141     WebCoreTestSupport
142     WebKit${DEBUG_SUFFIX}
143     gtest
144 )
145 add_library(TestWebKitLib SHARED
146     ${test_main_SOURCES}
147     ${TESTWEBKITAPI_DIR}/TestsController.cpp
148     ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/win/ScaleWebView.cpp
149     ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/win/WebViewDestruction.cpp
150     ${TESTWEBKITAPI_DIR}/win/HostWindow.cpp
151 )
152
153 target_link_libraries(TestWebKitLib ${test_webkit_LIBRARIES})
154
155 add_executable(TestWebKit
156     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
157 )
158 target_link_libraries(TestWebKit shlwapi)
159 add_dependencies(TestWebKit ${ForwardingHeadersForTestWebKitAPI_NAME})
160
161 add_test(TestWebKit ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebKit)
162 set_tests_properties(TestWebKit PROPERTIES TIMEOUT 60)
163
164 set(test_main_SOURCES
165     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
166 )
167
168 add_dependencies(TestWebCore TestWebCoreLib)
169 add_dependencies(TestWebKit TestWebKitLib)