Test: Use a xvfb wrapper for x11 test
[platform/upstream/libxkbcommon.git] / meson.build
index b64427d..0769919 100644 (file)
@@ -573,9 +573,11 @@ test_dep = declare_dependency(
     link_with: libxkbcommon_test_internal,
 )
 if get_option('enable-x11')
-    libxkbcommon_x11_internal = static_library(
+    libxkbcommon_x11_test_internal = static_library(
         'xkbcommon-x11-internal',
         libxkbcommon_x11_sources,
+        'test/xvfb-wrapper.c',
+        'test/xvfb-wrapper.h',
         include_directories: include_directories('src', 'include'),
         link_with: libxkbcommon_test_internal,
         dependencies: [
@@ -584,7 +586,7 @@ if get_option('enable-x11')
         ],
     )
     x11_test_dep = declare_dependency(
-        link_with: libxkbcommon_x11_internal,
+        link_with: libxkbcommon_x11_test_internal,
         dependencies: [
             test_dep,
             xcb_dep,
@@ -819,15 +821,36 @@ You can disable the documentation with -Denable-docs=false.''')
     )
     # TODO: Meson should provide this.
     docdir = get_option('datadir')/'doc'/meson.project_name()
-    custom_target(
+    doc_gen = custom_target(
         'doc',
         input: [doxyfile] + doxygen_input,
         output: 'html',
-        command: [doxygen_wrapper, doxygen, meson.current_build_dir()/'Doxyfile', meson.current_source_dir()],
+        command: [
+            doxygen_wrapper,
+            doxygen,
+            meson.current_build_dir()/'Doxyfile',
+            meson.current_source_dir(),
+        ],
         install: true,
         install_dir: docdir,
         build_by_default: true,
     )
+    if get_option('enable-cool-uris')
+        ensure_stable_urls = find_program('scripts'/'ensure-stable-doc-urls.py')
+        custom_target(
+            'doc-cool-uris',
+            input: [doc_gen, 'doc'/'cool-uris.yaml'],
+            output: 'html-xtra',
+            command: [
+                ensure_stable_urls,
+                'generate-redirections',
+                meson.current_source_dir()/'doc'/'cool-uris.yaml',
+                meson.current_build_dir()/'html'
+            ],
+            install: false,
+            build_by_default: true,
+        )
+    endif
 endif
 
 configure_file(output: 'config.h', configuration: configh_data)