Skip imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html.
[WebKit-https.git] / Source / PlatformGTK.cmake
1 add_subdirectory(${WEBCORE_DIR}/platform/gtk/po)
2
3 # This allows exposing a 'gir' target which builds all GObject introspection files.
4 if (ENABLE_INTROSPECTION)
5     add_custom_target(gir ALL DEPENDS ${GObjectIntrospectionTargets})
6 endif ()
7
8 list(APPEND DocumentationDependencies
9     WebKit2
10     "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml"
11     "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-${WEBKITGTK_API_VERSION}-sections.txt"
12 )
13
14 if (ENABLE_GTKDOC)
15     install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk-${WEBKITGTK_API_VERSION}/html/
16             DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html/webkit2gtk-${WEBKITGTK_API_VERSION}"
17     )
18     install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkitdomgtk-${WEBKITGTK_API_VERSION}/html/
19             DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html/webkitdomgtk-${WEBKITGTK_API_VERSION}"
20     )
21 endif ()
22
23 macro(ADD_GTKDOC_GENERATOR _stamp_name _extra_args)
24     add_custom_command(
25         OUTPUT "${CMAKE_BINARY_DIR}/${_stamp_name}"
26         DEPENDS ${DocumentationDependencies}
27         COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS} ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
28         COMMAND touch ${_stamp_name}
29         WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
30     )
31 endmacro()
32
33 add_gtkdoc_generator("docs-build.stamp" "")
34 if (ENABLE_GTKDOC)
35     add_custom_target(gtkdoc ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp")
36 elseif (NOT ENABLED_COMPILER_SANITIZERS AND NOT CMAKE_CROSSCOMPILING AND NOT APPLE)
37     add_custom_target(gtkdoc DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp")
38
39     # Add a default build step which check that documentation does not have any warnings
40     # or errors. This is useful to prevent breaking documentation inadvertently during
41     # the course of development.
42     if (DEVELOPER_MODE)
43         add_gtkdoc_generator("docs-build-no-html.stamp" "--skip-html")
44         add_custom_target(gtkdoc-no-html ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build-no-html.stamp")
45     endif ()
46 endif ()
47
48 add_custom_target(check
49     COMMAND ${TOOLS_DIR}/Scripts/run-gtk-tests
50     COMMAND ${TOOLS_DIR}/gtk/check-for-webkitdom-api-breaks
51 )
52
53 if (DEVELOPER_MODE)
54     configure_file(
55         ${TOOLS_DIR}/gtk/manifest.txt.in
56         ${CMAKE_BINARY_DIR}/manifest.txt
57     )
58
59     add_custom_command(
60         OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
61         DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
62         DEPENDS ${CMAKE_BINARY_DIR}/manifest.txt
63         DEPENDS WebKit2
64         DEPENDS gtkdoc
65         COMMAND ${TOOLS_DIR}/gtk/make-dist.py
66                 --source-dir=${CMAKE_SOURCE_DIR}
67                 --build-dir=${CMAKE_BINARY_DIR}
68                 --version=${PROJECT_VERSION}
69                 ${CMAKE_BINARY_DIR}/manifest.txt
70     )
71
72     add_custom_command(
73         OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
74         DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
75         COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
76     )
77
78     add_custom_target(dist
79         DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
80     )
81
82     add_custom_target(distcheck
83         DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
84         DEPENDS ${CMAKE_BINARY_DIR}/manifest.txt
85         DEPENDS WebKit2
86         DEPENDS gtkdoc
87         COMMAND ${TOOLS_DIR}/gtk/make-dist.py
88                 --check
89                 --source-dir=${CMAKE_SOURCE_DIR}
90                 --build-dir=${CMAKE_BINARY_DIR}
91                 --version=${PROJECT_VERSION}
92                 ${CMAKE_BINARY_DIR}/manifest.txt
93         COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
94     )
95 endif ()