6bb5eae64546ce84c371a656bbd220aed6228d39
[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     ${DERIVED_SOURCES_DIR}/ForwardingHeaders
21     ${TESTWEBKITAPI_DIR}/win
22     ${DERIVED_SOURCES_DIR}/WebKit/Interfaces
23 )
24
25 add_definitions(-DWEBCORE_EXPORT=)
26
27 set(test_webcore_LIBRARIES
28     Crypt32
29     Iphlpapi
30     Shlwapi
31     Usp10
32     WebCore${DEBUG_SUFFIX}
33     WebKit${DEBUG_SUFFIX}
34     gtest
35 )
36
37 set(TestWebCoreLib_SOURCES
38     ${test_main_SOURCES}
39     ${TESTWEBKITAPI_DIR}/TestsController.cpp
40     ${TESTWEBKITAPI_DIR}/Tests/WebCore/CalculationValue.cpp
41     ${TESTWEBKITAPI_DIR}/Tests/WebCore/CSSParser.cpp
42     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
43     ${TESTWEBKITAPI_DIR}/Tests/WebCore/TimeRanges.cpp
44     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
45 )
46
47 if (${WTF_PLATFORM_WIN_CAIRO})
48     list(APPEND test_webcore_LIBRARIES
49         cairo
50         libANGLE
51         libeay32
52         mfuuid
53         ssleay32
54         strmiids
55         vcruntime
56     )
57     list(APPEND TestWebCoreLib_SOURCES
58         ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/BitmapImage.cpp
59     )
60 else ()
61     list(APPEND test_webcore_LIBRARIES
62         ASL${DEBUG_SUFFIX}
63         AVFoundationCF${DEBUG_SUFFIX}
64         CFNetwork${DEBUG_SUFFIX}
65         CoreAudioToolbox${DEBUG_SUFFIX}
66         CoreFoundation${DEBUG_SUFFIX}
67         CoreGraphics${DEBUG_SUFFIX}
68         CoreMedia${DEBUG_SUFFIX}
69         CoreText${DEBUG_SUFFIX}
70         CoreVideo${DEBUG_SUFFIX}
71         MediaAccessibility${DEBUG_SUFFIX}
72         QuartzCore${DEBUG_SUFFIX}
73         SQLite3${DEBUG_SUFFIX}
74         WebKitSystemInterface${DEBUG_SUFFIX}
75         WebKitQuartzCoreAdditions${DEBUG_SUFFIX}
76         libdispatch${DEBUG_SUFFIX}
77         libexslt${DEBUG_SUFFIX}
78         libicuin${DEBUG_SUFFIX}
79         libicuuc${DEBUG_SUFFIX}
80         libxml2${DEBUG_SUFFIX}
81         libxslt${DEBUG_SUFFIX}
82         zdll${DEBUG_SUFFIX}
83     )
84 endif ()
85
86 add_library(TestWTFLib SHARED
87     ${test_main_SOURCES}
88     ${TestWTF_SOURCES}
89 )
90 set_target_properties(TestWTFLib PROPERTIES OUTPUT_NAME "TestWTF")
91 target_link_libraries(TestWTFLib ${test_wtf_LIBRARIES})
92
93 set(test_wtf_LIBRARIES
94     shlwapi
95 )
96 set(TestWTF_SOURCES
97 )
98
99 add_library(TestWebCoreLib SHARED
100     ${TestWebCoreLib_SOURCES}
101 )
102
103 target_link_libraries(TestWebCoreLib ${test_webcore_LIBRARIES})
104 set_target_properties(TestWebCoreLib PROPERTIES OUTPUT_NAME "TestWebCore")
105
106 add_executable(TestWebCore
107     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
108 )
109 target_link_libraries(TestWebCore shlwapi)
110
111
112 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebCore)
113 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
114
115 add_library(TestWebKitLib SHARED
116     ${test_main_SOURCES}
117     ${TESTWEBKITAPI_DIR}/TestsController.cpp
118     ${TESTWEBKITAPI_DIR}/Tests/WebKit/win/WebViewDestruction.cpp
119     ${TESTWEBKITAPI_DIR}/win/HostWindow.cpp
120 )
121
122 target_link_libraries(TestWebKitLib ${test_webcore_LIBRARIES})
123 set_target_properties(TestWebKitLib PROPERTIES OUTPUT_NAME "TestWebKit")
124
125 add_executable(TestWebKit
126     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
127 )
128 target_link_libraries(TestWebKit shlwapi)
129
130 add_test(TestWebKit ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebKit)
131 set_tests_properties(TestWebKit PROPERTIES TIMEOUT 60)
132
133 set(test_main_SOURCES
134     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
135 )