ba90917cb508882a5b33ca7da6be03b480ff7b98
[WebKit-https.git] / Tools / TestWebKitAPI / PlatformGTK.cmake
1 set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitAPI")
2
3 add_custom_target(TestWebKitAPI-forwarding-headers
4     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${TESTWEBKITAPI_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk --platform soup
5     DEPENDS WebKit-forwarding-headers
6 )
7
8 list(APPEND TestWebKit_DEPENDENCIES TestWebKitAPI-forwarding-headers)
9
10 set(test_main_SOURCES gtk/main.cpp)
11
12 # TestWTF
13 list(APPEND TestWTF_SOURCES
14     ${test_main_SOURCES}
15
16     Tests/WTF/glib/GUniquePtr.cpp
17     Tests/WTF/glib/WorkQueueGLib.cpp
18
19     glib/UtilitiesGLib.cpp
20 )
21
22 list(APPEND TestWTF_SYSTEM_INCLUDE_DIRECTORIES
23     ${GLIB_INCLUDE_DIRS}
24     ${GTK3_INCLUDE_DIRS}
25 )
26
27 list(APPEND TestWTF_LIBRARIES
28     ${GDK3_LIBRARIES}
29     ${GTK3_LIBRARIES}
30 )
31
32 # TestWebCore
33 list(APPEND TestWebCore_SOURCES
34     ${test_main_SOURCES}
35
36     Tests/WebCore/gstreamer/GStreamerTest.cpp
37     Tests/WebCore/gstreamer/GstMappedBuffer.cpp
38
39     glib/UtilitiesGLib.cpp
40 )
41
42 list(APPEND TestWebCore_SYSTEM_INCLUDE_DIRECTORIES
43     ${GLIB_INCLUDE_DIRS}
44     ${GTK3_INCLUDE_DIRS}
45 )
46
47 list(APPEND TestWebCore_LIBRARIES
48     ${GDK3_LIBRARIES}
49     ${GTK3_LIBRARIES}
50
51     WebCorePlatformGTK
52 )
53 ADD_WHOLE_ARCHIVE_TO_LIBRARIES(TestWebCore_LIBRARIES)
54
55 # TestWebKit
56 list(APPEND TestWebKit_SOURCES
57     ${test_main_SOURCES}
58
59     Tests/WebKit/gtk/InputMethodFilter.cpp
60
61     glib/UtilitiesGLib.cpp
62
63     gtk/PlatformUtilitiesGtk.cpp
64     gtk/PlatformWebViewGtk.cpp
65 )
66
67 list(APPEND TestWebKit_PRIVATE_INCLUDE_DIRECTORIES
68     "${CMAKE_SOURCE_DIR}/Source"
69 )
70
71 list(APPEND TestWebKit_SYSTEM_INCLUDE_DIRECTORIES
72     ${GLIB_INCLUDE_DIRS}
73     ${GTK3_INCLUDE_DIRS}
74 )
75
76 list(APPEND TestWebKit_LIBRARIES
77     ${GDK3_LIBRARIES}
78     ${GTK3_LIBRARIES}
79 )
80
81 # TestWebKitAPIBase
82 target_include_directories(TestWebKitAPIBase PRIVATE "${CMAKE_SOURCE_DIR}/Source")
83
84 # TestWebKitAPIInjectedBundle
85 target_sources(TestWebKitAPIInjectedBundle PRIVATE
86     glib/UtilitiesGLib.cpp
87
88     gtk/InjectedBundleControllerGtk.cpp
89     gtk/PlatformUtilitiesGtk.cpp
90 )
91 target_include_directories(TestWebKitAPIInjectedBundle PRIVATE
92     "${CMAKE_SOURCE_DIR}/Source"
93     ${GLIB_INCLUDE_DIRS}
94     ${GTK3_INCLUDE_DIRS}
95 )
96
97 # TestJSC
98 set(TestJSC_SOURCES
99     Tests/JavaScriptCore/glib/TestJSC.cpp
100 )
101
102 set(TestJSC_PRIVATE_INCLUDE_DIRECTORIES
103     ${CMAKE_BINARY_DIR}
104     ${TESTWEBKITAPI_DIR}
105     ${GLIB_INCLUDE_DIRS}
106     ${GTK3_INCLUDE_DIRS}
107     ${THIRDPARTY_DIR}/gtest/include
108     ${FORWARDING_HEADERS_DIR}
109     ${FORWARDING_HEADERS_DIR}/JavaScriptCore
110     ${FORWARDING_HEADERS_DIR}/JavaScriptCore/glib
111     ${DERIVED_SOURCES_JAVASCRIPCOREGTK_DIR}
112 )
113
114 set(TestJSC_LIBRARIES
115     ${GLIB_LIBRARIES}
116     ${GLIB_GMODULE_LIBRARIES}
117     WebKit::JavaScriptCore
118 )
119
120 set(TestJSC_DEFINITIONS
121     WEBKIT_SRC_DIR="${CMAKE_SOURCE_DIR}"
122 )
123
124 WEBKIT_EXECUTABLE_DECLARE(TestJSC)
125 WEBKIT_TEST(TestJSC)