Move FileSystem to WTF
[WebKit-https.git] / Tools / TestWebKitAPI / PlatformWPE.cmake
1 set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitAPI")
2 set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF "${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WTF")
3
4 # This is necessary because it is possible to build TestWebKitAPI with WebKit2
5 # disabled and this triggers the inclusion of the WebKit2 headers.
6 add_definitions(-DBUILDING_WEBKIT2__)
7
8 add_custom_target(TestWebKitAPI-forwarding-headers
9     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${TESTWEBKITAPI_DIR} --output ${FORWARDING_HEADERS_DIR} --platform wpe --platform soup
10     DEPENDS webkitwpe-forwarding-headers
11 )
12
13 list(APPEND TestWebKitAPI_DEPENDENCIES TestWebKitAPI-forwarding-headers)
14
15 include_directories(
16     ${FORWARDING_HEADERS_DIR}
17     ${FORWARDING_HEADERS_DIR}/JavaScriptCore
18     ${FORWARDING_HEADERS_DIR}/JavaScriptCore/glib
19     ${DERIVED_SOURCES_JAVASCRIPCOREWPE_DIR}
20     ${TOOLS_DIR}/wpe/backends
21 )
22
23 include_directories(SYSTEM
24     ${CAIRO_INCLUDE_DIRS}
25     ${GLIB_INCLUDE_DIRS}
26     ${GSTREAMER_INCLUDE_DIRS}
27     ${LIBSOUP_INCLUDE_DIRS}
28     ${WPE_INCLUDE_DIRS}
29     ${WPEBACKEND_FDO_INCLUDE_DIRS}
30 )
31
32 set(test_main_SOURCES
33     ${TESTWEBKITAPI_DIR}/generic/main.cpp
34 )
35
36 set(bundle_harness_SOURCES
37     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
38     ${TESTWEBKITAPI_DIR}/wpe/InjectedBundleControllerWPE.cpp
39     ${TESTWEBKITAPI_DIR}/wpe/PlatformUtilitiesWPE.cpp
40 )
41
42 set(webkit_api_harness_SOURCES
43     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
44     ${TESTWEBKITAPI_DIR}/wpe/PlatformUtilitiesWPE.cpp
45     ${TESTWEBKITAPI_DIR}/wpe/PlatformWebViewWPE.cpp
46 )
47
48 # TestWTF
49
50 list(APPEND TestWTF_SOURCES
51     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
52     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/GUniquePtr.cpp
53     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/WorkQueueGLib.cpp
54 )
55
56 # TestWebCore
57
58 add_executable(TestWebCore
59     ${test_main_SOURCES}
60     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
61     ${TESTWEBKITAPI_DIR}/TestsController.cpp
62     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileMonitor.cpp
63     ${TESTWEBKITAPI_DIR}/Tests/WebCore/gstreamer/GstMappedBuffer.cpp
64     ${TESTWEBKITAPI_DIR}/Tests/WebCore/gstreamer/GStreamerTest.cpp
65     ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
66     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
67     ${TESTWEBKITAPI_DIR}/Tests/WebCore/MIMETypeRegistry.cpp
68     ${TESTWEBKITAPI_DIR}/Tests/WebCore/PublicSuffix.cpp
69     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
70     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBufferTest.cpp
71     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URLParserTextEncoding.cpp
72 )
73
74 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
75 add_dependencies(TestWebCore ${TestWebKitAPI_DEPENDENCIES})
76
77 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
78 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
79 set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
80
81 # TestWebKit
82
83 list(APPEND test_webkit_api_LIBRARIES
84     WPEToolingBackends
85 )
86
87 add_executable(TestWebKit ${test_webkit_api_SOURCES})
88
89 target_link_libraries(TestWebKit ${test_webkit_api_LIBRARIES})
90 add_test(TestWebKit ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit/TestWebKit)
91 set_tests_properties(TestWebKit PROPERTIES TIMEOUT 60)
92 set_target_properties(TestWebKit PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit)
93
94 # TestWebKitAPIBase
95 list(APPEND TestWebKitAPIBase_LIBRARIES
96     WPEBackend-fdo-0.1
97 )
98 find_package(WPEBackend-fdo REQUIRED)
99 list(APPEND TestWebKitAPI_LIBRARIES ${WPEBACKEND_FDO_LIBRARIES})
100 list(APPEND TestWebKitAPIBase_SOURCES
101     ${TOOLS_DIR}/wpe/backends/ViewBackend.cpp
102     ${TOOLS_DIR}/wpe/backends/HeadlessViewBackend.cpp
103 )
104
105 # TestJSC
106
107 add_definitions(-DWEBKIT_SRC_DIR="${CMAKE_SOURCE_DIR}")
108 add_executable(TestJSC ${TESTWEBKITAPI_DIR}/Tests/JavaScriptCore/glib/TestJSC.cpp)
109 target_link_libraries(TestJSC
110     ${GLIB_LIBRARIES}
111     ${GLIB_GMODULE_LIBRARIES}
112     JavaScriptCore
113 )
114 add_test(TestJSC ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore/TestJSC)
115 add_dependencies(TestJSC ${TestWebKitAPI_DEPENDENCIES})
116 set_tests_properties(TestJSC PROPERTIES TIMEOUT 60)
117 set_target_properties(TestJSC PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore)
118
119 # Add an intermediate target between TestJSC and JavaScriptCore to ensure derived headers are copied into the forwarding header directory.
120 add_custom_target(pre-TestJSC DEPENDS JavaScriptCore)
121 add_dependencies(TestJSC pre-TestJSC)
122
123 if (COMPILER_IS_GCC_OR_CLANG)
124     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebCore -Wno-sign-compare
125                                             -Wno-undef
126                                             -Wno-unused-parameter)
127     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKit -Wno-sign-compare
128                                            -Wno-undef
129                                            -Wno-unused-parameter)
130     WEBKIT_ADD_TARGET_CXX_FLAGS(TestJSC -Wno-sign-compare
131                                         -Wno-undef
132                                         -Wno-unused-parameter)
133 endif ()