xref: /aosp_15_r20/external/wayland/doc/doxygen/meson.build (revision 84e872a0dc482bffdb63672969dd03a827d67c73)
1*84e872a0SLloyd Pique# Here be dragons
2*84e872a0SLloyd Pique
3*84e872a0SLloyd Piquedot_gv = {
4*84e872a0SLloyd Pique	'wayland-architecture': files('dot/wayland-architecture.gv'),
5*84e872a0SLloyd Pique	'x-architecture': files('dot/x-architecture.gv'),
6*84e872a0SLloyd Pique}
7*84e872a0SLloyd Pique
8*84e872a0SLloyd Pique# This is a workaround for Meson's custom_target() directive, which
9*84e872a0SLloyd Pique# currently does not support outputs pointing to a sub-directory
10*84e872a0SLloyd Pique# XXX: try turning these into maps, so they can be indexed with picture name
11*84e872a0SLloyd Piquedot_png = []
12*84e872a0SLloyd Piquedot_map = []
13*84e872a0SLloyd Pique
14*84e872a0SLloyd Piquedoxygen_conf = configuration_data()
15*84e872a0SLloyd Piquedoxygen_conf.set('VERSION', meson.project_version())
16*84e872a0SLloyd Piquedoxygen_conf.set('top_builddir', meson.project_build_root())
17*84e872a0SLloyd Piquewayland_doxygen = configure_file(
18*84e872a0SLloyd Pique	input: 'wayland.doxygen.in',
19*84e872a0SLloyd Pique	output: 'wayland.doxygen',
20*84e872a0SLloyd Pique	configuration: doxygen_conf,
21*84e872a0SLloyd Pique)
22*84e872a0SLloyd Pique
23*84e872a0SLloyd Piqueshared_files = files([
24*84e872a0SLloyd Pique	'../../src/wayland-util.h',
25*84e872a0SLloyd Pique])
26*84e872a0SLloyd Pique
27*84e872a0SLloyd Piqueclient_files = files([
28*84e872a0SLloyd Pique	'../../src/wayland-client.c',
29*84e872a0SLloyd Pique	'../../src/wayland-client.h',
30*84e872a0SLloyd Pique	'../../src/wayland-client-core.h',
31*84e872a0SLloyd Pique])
32*84e872a0SLloyd Pique
33*84e872a0SLloyd Piqueserver_files = files([
34*84e872a0SLloyd Pique	'../../src/event-loop.c',
35*84e872a0SLloyd Pique	'../../src/wayland-server.c',
36*84e872a0SLloyd Pique	'../../src/wayland-server.h',
37*84e872a0SLloyd Pique	'../../src/wayland-server-core.h',
38*84e872a0SLloyd Pique	'../../src/wayland-shm.c',
39*84e872a0SLloyd Pique])
40*84e872a0SLloyd Pique
41*84e872a0SLloyd Piquecursor_files = files([
42*84e872a0SLloyd Pique	'../../cursor/wayland-cursor.c',
43*84e872a0SLloyd Pique	'../../cursor/wayland-cursor.h',
44*84e872a0SLloyd Pique])
45*84e872a0SLloyd Pique
46*84e872a0SLloyd Piqueextra_client_files = [
47*84e872a0SLloyd Pique	'mainpage.dox',
48*84e872a0SLloyd Pique	wayland_client_protocol_h,
49*84e872a0SLloyd Pique]
50*84e872a0SLloyd Pique
51*84e872a0SLloyd Piqueextra_server_files = [
52*84e872a0SLloyd Pique	'mainpage.dox',
53*84e872a0SLloyd Pique	wayland_server_protocol_h,
54*84e872a0SLloyd Pique]
55*84e872a0SLloyd Pique
56*84e872a0SLloyd Piqueextra_cursor_files = [
57*84e872a0SLloyd Pique	'mainpage.dox',
58*84e872a0SLloyd Pique]
59*84e872a0SLloyd Pique
60*84e872a0SLloyd Piquegen_doxygen = find_program('gen-doxygen.py')
61*84e872a0SLloyd Pique
62*84e872a0SLloyd Piquesubdir('xml')
63*84e872a0SLloyd Pique
64*84e872a0SLloyd Piqueformats = {
65*84e872a0SLloyd Pique	'html': {
66*84e872a0SLloyd Pique		'Client': shared_files + client_files + extra_client_files,
67*84e872a0SLloyd Pique		'Server': shared_files + server_files + extra_server_files,
68*84e872a0SLloyd Pique		'Cursor': shared_files + cursor_files + extra_cursor_files,
69*84e872a0SLloyd Pique	},
70*84e872a0SLloyd Pique}
71*84e872a0SLloyd Pique
72*84e872a0SLloyd Piqueforeach f_name, sections: formats
73*84e872a0SLloyd Pique	foreach s_name, s_files: sections
74*84e872a0SLloyd Pique		t_name = '@0@-@1@-doc'.format(f_name, s_name)
75*84e872a0SLloyd Pique
76*84e872a0SLloyd Pique		# We do not really need an output file, but Meson
77*84e872a0SLloyd Pique		# will complain if one is not set, so we use a
78*84e872a0SLloyd Pique		# dummy 'stamp' file
79*84e872a0SLloyd Pique		stamp = join_paths(meson.current_build_dir(), '@[email protected]'.format(t_name))
80*84e872a0SLloyd Pique		custom_target(
81*84e872a0SLloyd Pique			t_name,
82*84e872a0SLloyd Pique			command: [
83*84e872a0SLloyd Pique				gen_doxygen,
84*84e872a0SLloyd Pique				# XXX pass doxygen path as argument
85*84e872a0SLloyd Pique				'--builddir=@OUTDIR@',
86*84e872a0SLloyd Pique				'--section=@0@'.format(s_name),
87*84e872a0SLloyd Pique				'--output-format=@0@'.format(f_name),
88*84e872a0SLloyd Pique				'--stamp=@0@'.format(stamp),
89*84e872a0SLloyd Pique				wayland_doxygen,
90*84e872a0SLloyd Pique				'@INPUT@',
91*84e872a0SLloyd Pique			],
92*84e872a0SLloyd Pique			input: s_files,
93*84e872a0SLloyd Pique			output: '@[email protected]'.format(t_name),
94*84e872a0SLloyd Pique			depends: [dot_png, dot_map],
95*84e872a0SLloyd Pique			build_by_default: true,
96*84e872a0SLloyd Pique		)
97*84e872a0SLloyd Pique	endforeach
98*84e872a0SLloyd Piqueendforeach
99*84e872a0SLloyd Pique
100*84e872a0SLloyd Piqueman_files = shared_files + server_files + client_files + cursor_files
101*84e872a0SLloyd Piquestamp = join_paths(meson.current_build_dir(), 'man3.stamp')
102*84e872a0SLloyd Piquecustom_target(
103*84e872a0SLloyd Pique	'man-pages-3',
104*84e872a0SLloyd Pique	command: [
105*84e872a0SLloyd Pique		gen_doxygen,
106*84e872a0SLloyd Pique		'--builddir=@OUTDIR@',
107*84e872a0SLloyd Pique		'--output-format=man3',
108*84e872a0SLloyd Pique		'--stamp=@0@'.format(stamp),
109*84e872a0SLloyd Pique		wayland_doxygen,
110*84e872a0SLloyd Pique		'@INPUT@',
111*84e872a0SLloyd Pique	],
112*84e872a0SLloyd Pique	input: man_files,
113*84e872a0SLloyd Pique	output: 'man3',
114*84e872a0SLloyd Pique	build_by_default: true,
115*84e872a0SLloyd Pique	install: true,
116*84e872a0SLloyd Pique	install_dir: join_paths(get_option('prefix'), get_option('mandir')),
117*84e872a0SLloyd Pique)
118