[CMake] Add WebKit::JavaScriptCore target
[WebKit-https.git] / Tools / TestWebKitAPI / PlatformWPE.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 wpe --platform soup
5     DEPENDS webkitwpe-forwarding-headers
6 )
7
8 list(APPEND TestWebKit_DEPENDENCIES TestWebKitAPI-forwarding-headers)
9
10 include_directories(SYSTEM
11     ${CAIRO_INCLUDE_DIRS}
12     ${GLIB_INCLUDE_DIRS}
13     ${GSTREAMER_INCLUDE_DIRS}
14     ${GSTREAMER_AUDIO_INCLUDE_DIRS}
15     ${LIBSOUP_INCLUDE_DIRS}
16     ${WPE_INCLUDE_DIRS}
17     ${WPEBACKEND_FDO_INCLUDE_DIRS}
18 )
19
20 set(test_main_SOURCES generic/main.cpp)
21
22 # TestWTF
23 list(APPEND TestWTF_SOURCES
24     ${test_main_SOURCES}
25
26     Tests/WTF/glib/GUniquePtr.cpp
27     Tests/WTF/glib/WorkQueueGLib.cpp
28
29     glib/UtilitiesGLib.cpp
30 )
31
32 list(APPEND TestWTF_SYSTEM_INCLUDE_DIRECTORIES
33     ${GLIB_INCLUDE_DIRS}
34 )
35
36 # TestWebCore
37 list(APPEND TestWebCore_SOURCES
38     ${test_main_SOURCES}
39
40     Tests/WebCore/gstreamer/GStreamerTest.cpp
41     Tests/WebCore/gstreamer/GstMappedBuffer.cpp
42
43     glib/UtilitiesGLib.cpp
44 )
45
46 list(APPEND TestWebCore_SYSTEM_INCLUDE_DIRECTORIES
47     ${GLIB_INCLUDE_DIRS}
48 )
49
50 # TestWebKit
51 list(APPEND TestWebKit_SOURCES
52     ${test_main_SOURCES}
53
54     glib/UtilitiesGLib.cpp
55
56     wpe/PlatformUtilitiesWPE.cpp
57     wpe/PlatformWebViewWPE.cpp
58 )
59
60 list(APPEND TestWebKit_PRIVATE_INCLUDE_DIRECTORIES
61     ${CMAKE_SOURCE_DIR}/Source
62     ${FORWARDING_HEADERS_DIR}
63     ${WPEBACKEND_FDO_INCLUDE_DIRS}
64     ${TOOLS_DIR}/wpe/backends
65 )
66
67 list(APPEND TestWebKit_SYSTEM_INCLUDE_DIRECTORIES
68     ${GLIB_INCLUDE_DIRS}
69 )
70
71 list(APPEND TestWebKit_LIBRARIES
72     ${WPEBACKEND_FDO_LIBRARIES}
73     WPEToolingBackends
74 )
75
76 # TestWebKitAPIBase
77 target_include_directories(TestWebKitAPIBase PRIVATE
78     ${CMAKE_SOURCE_DIR}/Source
79     ${FORWARDING_HEADERS_DIR}
80 )
81
82 # TestWebKitAPIInjectedBundle
83 target_sources(TestWebKitAPIInjectedBundle PRIVATE
84     glib/UtilitiesGLib.cpp
85
86     wpe/InjectedBundleControllerWPE.cpp
87     wpe/PlatformUtilitiesWPE.cpp
88 )
89 target_include_directories(TestWebKitAPIInjectedBundle PRIVATE
90     ${CMAKE_SOURCE_DIR}/Source
91     ${FORWARDING_HEADERS_DIR}
92 )
93
94 # TestJSC
95 set(TestJSC_SOURCES
96     Tests/JavaScriptCore/glib/TestJSC.cpp
97 )
98
99 set(TestJSC_PRIVATE_INCLUDE_DIRECTORIES
100     ${CMAKE_BINARY_DIR}
101     ${TESTWEBKITAPI_DIR}
102     ${THIRDPARTY_DIR}/gtest/include
103     ${FORWARDING_HEADERS_DIR}
104     ${FORWARDING_HEADERS_DIR}/JavaScriptCore
105     ${FORWARDING_HEADERS_DIR}/JavaScriptCore/glib
106     ${DERIVED_SOURCES_JAVASCRIPCOREWPE_DIR}
107 )
108
109 set(TestJSC_LIBRARIES
110     ${GLIB_LIBRARIES}
111     ${GLIB_GMODULE_LIBRARIES}
112     WebKit::JavaScriptCore
113 )
114
115 set(TestJSC_DEFINITIONS
116     WEBKIT_SRC_DIR="${CMAKE_SOURCE_DIR}"
117 )
118
119 WEBKIT_EXECUTABLE_DECLARE(TestJSC)
120 WEBKIT_TEST(TestJSC)