[WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatfor...
[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 )
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}/glib/UtilitiesGLib.cpp
31     ${TESTWEBKITAPI_DIR}/wpe/InjectedBundleControllerWPE.cpp
32     ${TESTWEBKITAPI_DIR}/wpe/PlatformUtilitiesWPE.cpp
33 )
34
35 # TestWTF
36
37 list(APPEND TestWTF_SOURCES
38     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/GUniquePtr.cpp
39     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/WorkQueueGLib.cpp
40 )
41
42 # TestWebCore
43
44 add_executable(TestWebCore
45     ${test_main_SOURCES}
46     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
47     ${TESTWEBKITAPI_DIR}/TestsController.cpp
48     ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
49     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
50     ${TESTWEBKITAPI_DIR}/Tests/WebCore/MIMETypeRegistry.cpp
51     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
52     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
53     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBufferTest.cpp
54     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileMonitor.cpp
55     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileSystem.cpp
56     ${TESTWEBKITAPI_DIR}/Tests/WebCore/PublicSuffix.cpp
57 )
58
59 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES} -Wl,--start-group WebCore WebCoreDerivedSources -Wl,--end-group)
60 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
61
62 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
63 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
64 set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
65
66 if (COMPILER_IS_GCC_OR_CLANG)
67     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebCore -Wno-sign-compare
68                                             -Wno-undef
69                                             -Wno-unused-parameter)
70 endif ()