Update the test to ensure OutOfMemoryError is thrown as intended
[WebKit-https.git] / Source / PlatformWPE.cmake
index 21596bf..5a83266 100644 (file)
@@ -1,44 +1,39 @@
-if (DEVELOPER_MODE)
-    find_package(Xz REQUIRED)
+include(GtkDoc)
+include(WebKitDist)
 
-    configure_file(
-        ${TOOLS_DIR}/wpe/manifest.txt.in
-        ${CMAKE_BINARY_DIR}/manifest.txt
-    )
+list(APPEND DocumentationDependencies
+    WebKit
+    "${CMAKE_SOURCE_DIR}/Source/WebKit/UIProcess/API/wpe/docs/wpe-docs.sgml"
+    "${CMAKE_SOURCE_DIR}/Source/WebKit/WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-docs.sgml"
+    "${CMAKE_SOURCE_DIR}/Source/WebKit/UIProcess/API/wpe/docs/wpe-${WPE_API_VERSION}-sections.txt"
+    "${CMAKE_SOURCE_DIR}/Source/WebKit/WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-${WPE_API_VERSION}-sections.txt"
+)
 
-    add_custom_target(distcheck
-        COMMENT "Checking release tarball: wpewebkit-${PROJECT_VERSION}.tar"
-        DEPENDS "${CMAKE_BINARY_DIR}/manifest.txt"
-                "${TOOLS_DIR}/gtk/make-dist.py"
-        COMMAND "${TOOLS_DIR}/gtk/make-dist.py"
-                "--check" "--port=WPE"
-                "--tarball-name=wpewebkit"
-                "--source-dir=${CMAKE_SOURCE_DIR}"
-                "--build-dir=${CMAKE_BINARY_DIR}"
-                "--version=${PROJECT_VERSION}"
-                "${CMAKE_BINARY_DIR}/manifest.txt"
-        COMMAND "${XZ_EXECUTABLE}" "-evfQ"
-                "${CMAKE_BINARY_DIR}/wpewebkit-${PROJECT_VERSION}.tar"
-        USES_TERMINAL
+if (ENABLE_GTKDOC)
+    install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/wpe-${WPE_API_VERSION}/html/wpe-${WPE_API_VERSION}
+            DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html"
     )
-
-    add_custom_command(
-        COMMENT "Creating release tarball: wpewebkit-${PROJECT_VERSION}.tar.xz"
-        OUTPUT "${CMAKE_BINARY_DIR}/wpewebkit-${PROJECT_VERSION}.tar.xz"
-        MAIN_DEPENDENCY "${CMAKE_BINARY_DIR}/manifest.txt"
-        DEPENDS "${TOOLS_DIR}/gtk/make-dist.py"
-        COMMAND "${TOOLS_DIR}/gtk/make-dist.py"
-                "--tarball-name=wpewebkit"
-                "--source-dir=${CMAKE_SOURCE_DIR}"
-                "--build-dir=${CMAKE_BINARY_DIR}"
-                "--version=${PROJECT_VERSION}"
-                "${CMAKE_BINARY_DIR}/manifest.txt"
-        COMMAND "${XZ_EXECUTABLE}" "-evfQ"
-                "${CMAKE_BINARY_DIR}/wpewebkit-${PROJECT_VERSION}.tar"
-        USES_TERMINAL
+    install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/wpe-webextensions-${WPE_API_VERSION}/html/wpe-webextensions-${WPE_API_VERSION}
+        DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html"
     )
+endif ()
 
-    add_custom_target(dist
-        DEPENDS "${CMAKE_BINARY_DIR}/wpewebkit-${PROJECT_VERSION}.tar.xz"
-    )
+ADD_GTKDOC_GENERATOR("docs-build.stamp" "--wpe")
+if (ENABLE_GTKDOC)
+    add_custom_target(gtkdoc ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp")
+elseif (NOT ENABLED_COMPILER_SANITIZERS AND NOT CMAKE_CROSSCOMPILING AND NOT APPLE)
+    add_custom_target(gtkdoc DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp")
+
+    # Add a default build step which check that documentation does not have any warnings
+    # or errors. This is useful to prevent breaking documentation inadvertently during
+    # the course of development.
+    if (DEVELOPER_MODE)
+        ADD_GTKDOC_GENERATOR("docs-build-no-html.stamp" "--wpe;--skip-html")
+        add_custom_target(gtkdoc-no-html ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build-no-html.stamp")
+    endif ()
+endif ()
+
+if (DEVELOPER_MODE)
+    add_custom_target(Documentation DEPENDS gtkdoc)
+    WEBKIT_DECLARE_DIST_TARGETS(WPE wpewebkit ${TOOLS_DIR}/wpe/manifest.txt.in)
 endif ()