f203950edd46f641fa36167ff140a6d399a46dac
[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     )
100 endif ()
101
102 add_library(TestWTFLib SHARED
103     ${test_main_SOURCES}
104     ${TestWTF_SOURCES}
105 )
106 set_target_properties(TestWTFLib PROPERTIES OUTPUT_NAME "TestWTFLib")
107 target_link_libraries(TestWTFLib ${test_wtf_LIBRARIES})
108 add_dependencies(TestWTFLib ${ForwardingHeadersForTestWebKitAPI_NAME})
109
110 set(test_wtf_LIBRARIES
111     shlwapi
112 )
113 set(TestWTF_SOURCES
114 )
115
116 add_library(TestWebCoreLib SHARED
117     ${TestWebCoreLib_SOURCES}
118 )
119
120 target_link_libraries(TestWebCoreLib ${test_webcore_LIBRARIES})
121 set_target_properties(TestWebCoreLib PROPERTIES OUTPUT_NAME "TestWebCoreLib")
122
123 add_executable(TestWebCore
124     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
125 )
126 target_link_libraries(TestWebCore shlwapi)
127 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
128
129
130 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebCore)
131 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
132
133 if (${WTF_PLATFORM_WIN_CAIRO})
134     include_directories(
135         ${CAIRO_INCLUDE_DIRS}
136     )
137 endif ()
138
139 set(test_webkit_LIBRARIES
140     WebCoreTestSupport
141     WebKit${DEBUG_SUFFIX}
142     gtest
143 )
144 add_library(TestWebKitLib 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(TestWebKitLib ${test_webkit_LIBRARIES})
153
154 add_executable(TestWebKit
155     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
156 )
157 target_link_libraries(TestWebKit shlwapi)
158 add_dependencies(TestWebKit ${ForwardingHeadersForTestWebKitAPI_NAME})
159
160 add_test(TestWebKit ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebKit)
161 set_tests_properties(TestWebKit PROPERTIES TIMEOUT 60)
162
163 set(test_main_SOURCES
164     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
165 )
166
167 add_dependencies(TestWebCore TestWebCoreLib)
168 add_dependencies(TestWebKit TestWebKitLib)