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