diff options
| author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-08-27 11:02:09 -0400 |
|---|---|---|
| committer | Xavier Claessens <xclaesse@gmail.com> | 2023-08-29 13:34:23 -0400 |
| commit | 494bdbd3345d1c2d20cf2520249962bd32fc61e6 (patch) | |
| tree | 9c543fe1c84c8d2b58f97f39f847ed8c53a9be63 /test cases/frameworks/36 gtkdoc cpp | |
| parent | 4eb9c84cf97427a11af7ec928c849e4289862202 (diff) | |
| download | meson-494bdbd3345d1c2d20cf2520249962bd32fc61e6.tar.gz | |
gnome: Fix crash in gtkdoc and generate_gir in C++ projects
gtkdoc() and generate_gir() methods assumes there is a C compiler, but
pure C++ projects might not add it explicitly.
Fixes: #12162
Diffstat (limited to 'test cases/frameworks/36 gtkdoc cpp')
| -rw-r--r-- | test cases/frameworks/36 gtkdoc cpp/foo-docs.xml | 16 | ||||
| -rw-r--r-- | test cases/frameworks/36 gtkdoc cpp/foo.cpp | 5 | ||||
| -rw-r--r-- | test cases/frameworks/36 gtkdoc cpp/foo.h | 1 | ||||
| -rw-r--r-- | test cases/frameworks/36 gtkdoc cpp/meson.build | 13 | ||||
| -rw-r--r-- | test cases/frameworks/36 gtkdoc cpp/test.json | 17 |
5 files changed, 52 insertions, 0 deletions
diff --git a/test cases/frameworks/36 gtkdoc cpp/foo-docs.xml b/test cases/frameworks/36 gtkdoc cpp/foo-docs.xml new file mode 100644 index 000000000..85c673c57 --- /dev/null +++ b/test cases/frameworks/36 gtkdoc cpp/foo-docs.xml @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<!DOCTYPE book PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN' + 'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd' [ +<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> +<!ENTITY version SYSTEM "version.xml"> +]> +<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude"> + <bookinfo> + <title>Foo Reference Manual</title> + </bookinfo> + + <chapter id="foo"> + <title>GLib Core Application Support</title> + <xi:include href="xml/foo.xml" /> + </chapter> +</book> diff --git a/test cases/frameworks/36 gtkdoc cpp/foo.cpp b/test cases/frameworks/36 gtkdoc cpp/foo.cpp new file mode 100644 index 000000000..15fa26980 --- /dev/null +++ b/test cases/frameworks/36 gtkdoc cpp/foo.cpp @@ -0,0 +1,5 @@ +#include "foo.h" + +int foo_do_something(void) { + return 42; +} diff --git a/test cases/frameworks/36 gtkdoc cpp/foo.h b/test cases/frameworks/36 gtkdoc cpp/foo.h new file mode 100644 index 000000000..cac03d3c1 --- /dev/null +++ b/test cases/frameworks/36 gtkdoc cpp/foo.h @@ -0,0 +1 @@ +int foo_do_something(void); diff --git a/test cases/frameworks/36 gtkdoc cpp/meson.build b/test cases/frameworks/36 gtkdoc cpp/meson.build new file mode 100644 index 000000000..747eae546 --- /dev/null +++ b/test cases/frameworks/36 gtkdoc cpp/meson.build @@ -0,0 +1,13 @@ +project('gnome module without C', 'cpp') + +gtkdoc = find_program('gtkdoc-scan', required: false) +if not gtkdoc.found() + error('MESON_SKIP_TEST gtkdoc not found.') +endif + +gnome = import('gnome') + +lib = library('foo++', 'foo.cpp') +gnome.gtkdoc('foo', + src_dir: '.', + main_xml : 'foo-docs.xml',) diff --git a/test cases/frameworks/36 gtkdoc cpp/test.json b/test cases/frameworks/36 gtkdoc cpp/test.json new file mode 100644 index 000000000..b2d9bc88f --- /dev/null +++ b/test cases/frameworks/36 gtkdoc cpp/test.json @@ -0,0 +1,17 @@ +{ + "installed": [ + {"type": "file", "file": "usr/share/gtk-doc/html/foo/up-insensitive.png"}, + {"type": "file", "file": "usr/share/gtk-doc/html/foo/home.png"}, + {"type": "file", "file": "usr/share/gtk-doc/html/foo/foo.html"}, + {"type": "file", "file": "usr/share/gtk-doc/html/foo/foo-foo.html"}, + {"type": "file", "file": "usr/share/gtk-doc/html/foo/style.css"}, + {"type": "file", "file": "usr/share/gtk-doc/html/foo/index.html"}, + {"type": "file", "file": "usr/share/gtk-doc/html/foo/foo.devhelp2"}, + {"type": "file", "file": "usr/share/gtk-doc/html/foo/left.png"}, + {"type": "file", "file": "usr/share/gtk-doc/html/foo/left-insensitive.png"}, + {"type": "file", "file": "usr/share/gtk-doc/html/foo/right-insensitive.png"}, + {"type": "file", "file": "usr/share/gtk-doc/html/foo/up.png"}, + {"type": "file", "file": "usr/share/gtk-doc/html/foo/right.png"} + ], + "skip_on_jobname": ["azure", "msys2"] +} |
