Unreviewed. The WPE port should build TestWebKitAPI with the same
[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} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${TESTWEBKITAPI_DIR} --output ${FORWARDING_HEADERS_DIR} --platform wpe --platform soup
10     DEPENDS webkit2wpe-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 )
19
20 include_directories(SYSTEM
21     ${GLIB_INCLUDE_DIRS}
22     ${LIBSOUP_INCLUDE_DIRS}
23 )
24
25 set(test_main_SOURCES
26     ${TESTWEBKITAPI_DIR}/wpe/main.cpp
27 )
28
29 set(bundle_harness_SOURCES
30     ${TESTWEBKITAPI_DIR}/wpe/InjectedBundleControllerWPE.cpp
31     ${TESTWEBKITAPI_DIR}/wpe/PlatformUtilitiesWPE.cpp
32 )
33
34 # TestWTF
35
36 list(APPEND TestWTF_SOURCES
37     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/GUniquePtr.cpp
38     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/WorkQueueGLib.cpp
39 )
40
41 # TestWebCore
42
43 add_executable(TestWebCore
44     ${test_main_SOURCES}
45     ${TESTWEBKITAPI_DIR}/TestsController.cpp
46     ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
47     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
48     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
49     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
50     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBufferTest.cpp
51     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileSystem.cpp
52     ${TESTWEBKITAPI_DIR}/Tests/WebCore/PublicSuffix.cpp
53 )
54
55 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
56 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
57
58 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
59 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
60 set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
61
62 if (COMPILER_IS_GCC_OR_CLANG)
63     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebCore -Wno-sign-compare
64                                             -Wno-undef
65                                             -Wno-unused-parameter)
66 endif ()