Unreviewed, rolling out r228431.
[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 set(ForwardingHeadersForTestWebKitAPI_NAME TestWebKitAPI-forwarding-headers)
14
15 include_directories(
16     ${FORWARDING_HEADERS_DIR}
17     ${FORWARDING_HEADERS_DIR}/JavaScriptCore
18     ${TOOLS_DIR}/wpe/HeadlessViewBackend
19 )
20
21 include_directories(SYSTEM
22     ${CAIRO_INCLUDE_DIRS}
23     ${GLIB_INCLUDE_DIRS}
24     ${LIBSOUP_INCLUDE_DIRS}
25 )
26
27 set(test_main_SOURCES
28     ${TESTWEBKITAPI_DIR}/wpe/main.cpp
29 )
30
31 set(bundle_harness_SOURCES
32     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
33     ${TESTWEBKITAPI_DIR}/wpe/InjectedBundleControllerWPE.cpp
34     ${TESTWEBKITAPI_DIR}/wpe/PlatformUtilitiesWPE.cpp
35 )
36
37 set(webkit_api_harness_SOURCES
38     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
39     ${TESTWEBKITAPI_DIR}/wpe/PlatformUtilitiesWPE.cpp
40     ${TESTWEBKITAPI_DIR}/wpe/PlatformWebViewWPE.cpp
41 )
42
43 # TestWTF
44
45 list(APPEND TestWTF_SOURCES
46     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/GUniquePtr.cpp
47     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/WorkQueueGLib.cpp
48 )
49
50 # TestWebCore
51
52 add_executable(TestWebCore
53     ${test_main_SOURCES}
54     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
55     ${TESTWEBKITAPI_DIR}/TestsController.cpp
56     ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
57     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
58     ${TESTWEBKITAPI_DIR}/Tests/WebCore/MIMETypeRegistry.cpp
59     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
60     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
61     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBufferTest.cpp
62     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileMonitor.cpp
63     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileSystem.cpp
64     ${TESTWEBKITAPI_DIR}/Tests/WebCore/PublicSuffix.cpp
65 )
66
67 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
68 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
69
70 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
71 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
72 set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
73
74 # TestWebKit
75
76 list(APPEND test_webkit_api_LIBRARIES
77     WPEHeadlessViewBackend
78 )
79
80 add_executable(TestWebKit ${test_webkit_api_SOURCES})
81
82 target_link_libraries(TestWebKit ${test_webkit_api_LIBRARIES})
83 add_test(TestWebKit ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit/TestWebKit)
84 set_tests_properties(TestWebKit PROPERTIES TIMEOUT 60)
85 set_target_properties(TestWebKit PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit)
86
87 if (COMPILER_IS_GCC_OR_CLANG)
88     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebCore -Wno-sign-compare
89                                             -Wno-undef
90                                             -Wno-unused-parameter)
91     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKit -Wno-sign-compare
92                                            -Wno-undef
93                                            -Wno-unused-parameter)
94 endif ()