mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-10-29 05:40:16 -04:00 
			
		
		
		
	Add Meson build
Meson is a next generation build system, simpler than Autotools and also faster and more portable. Most importantly, it will make integrating ASan easier in CI. The goal is to maintain feature parity of the Meson build with the Autotools build, until such time when we can drop the latter. Add a script which generates the desired Doxygen configuration for our various output formats and executes it using that configuration. This is not something Meson can or should do. Fixes: https://gitlab.freedesktop.org/wayland/wayland/issues/80 [daniels: Changed to bump version, use GitLab issues URL, remove header checks not used in any code, remove pre-pkg-config Expat support, added missing include paths to wayland-egl and cpp-compile-test, added GitLab CI. Bumped version, removed unnecessary pkg-config paths.] [daniels: Properly install into mandir/man3 via some gross paramaterisation, generate real stamp files.] Pekka: - squashed patches - removed MAKEFLAGS from meson CI - remove unused PACKAGE* defines - fix up scanner dependency handling - instead of host_scanner option, build wayland-scanner twice when cross-compiling - changed .pc files to match more closely the autotools versions - reorder doxygen man sources to reduce diff to autotools - fix pkgconfig.generate syntax warnings (new in Meson) - bump meson version to 0.47 for configure_file(copy) and run_command(check) - move doc tool checks into doc/meson.build, needed in more places - make all doc tools mandatory if building docs - check dot and doxygen versions - add build files under doc/publican - reindent to match Weston Meson style Simon: - Remove install arg from configure_file - Don't build wayland-scanner twice during cross-build - Fix naming of the threads dependency - Store tests in dict - Add missing HAVE_* decls for functions - Remove unused cc_native variable - Make doxygen targets a dict - Make dot_gv a dict - Use dicts in man_pages - Make decls use dicts - Make generated_headers use dicts - Align Meson version number with autotool's Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com> Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
		
							parent
							
								
									0d3044f2ea
								
							
						
					
					
						commit
						60acba6e0f
					
				
					 17 changed files with 1087 additions and 3 deletions
				
			
		
							
								
								
									
										105
									
								
								doc/doxygen/meson.build
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										105
									
								
								doc/doxygen/meson.build
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,105 @@ | |||
| # Here be dragons | ||||
| 
 | ||||
| dot_gv = { | ||||
| 	'wayland-architecture': files('dot/wayland-architecture.gv'), | ||||
| 	'x-architecture': files('dot/x-architecture.gv'), | ||||
| } | ||||
| 
 | ||||
| # This is a workaround for Meson's custom_target() directive, which | ||||
| # currently does not support outputs pointing to a sub-directory | ||||
| # XXX: try turning these into maps, so they can be indexed with picture name | ||||
| dot_png = [] | ||||
| dot_map = [] | ||||
| 
 | ||||
| doxygen_conf = configuration_data() | ||||
| doxygen_conf.set('VERSION', meson.project_version()) | ||||
| doxygen_conf.set('top_builddir', meson.build_root()) | ||||
| wayland_doxygen = configure_file( | ||||
| 	input: 'wayland.doxygen.in', | ||||
| 	output: 'wayland.doxygen', | ||||
| 	configuration: doxygen_conf, | ||||
| ) | ||||
| 
 | ||||
| shared_files = files([ | ||||
| 	'../../src/wayland-util.h', | ||||
| ]) | ||||
| 
 | ||||
| client_files = files([ | ||||
| 	'../../src/wayland-client.c', | ||||
| 	'../../src/wayland-client.h', | ||||
| 	'../../src/wayland-client-core.h', | ||||
| ]) | ||||
| 
 | ||||
| server_files = files([ | ||||
| 	'../../src/event-loop.c', | ||||
| 	'../../src/wayland-server.c', | ||||
| 	'../../src/wayland-server.h', | ||||
| 	'../../src/wayland-server-core.h', | ||||
| 	'../../src/wayland-shm.c', | ||||
| ]) | ||||
| 
 | ||||
| extra_client_files = [ | ||||
| 	'mainpage.dox', | ||||
| 	wayland_client_protocol_h, | ||||
| ] | ||||
| 
 | ||||
| extra_server_files = [ | ||||
| 	'mainpage.dox', | ||||
| 	wayland_server_protocol_h, | ||||
| ] | ||||
| 
 | ||||
| gen_doxygen = find_program('gen-doxygen.py') | ||||
| 
 | ||||
| subdir('xml') | ||||
| 
 | ||||
| formats = { | ||||
| 	'html': { | ||||
| 		'Client': shared_files + client_files + extra_client_files, | ||||
| 		'Server': shared_files + server_files + extra_server_files, | ||||
| 	}, | ||||
| } | ||||
| 
 | ||||
| foreach f_name, sections: formats | ||||
| 	foreach s_name, s_files: sections | ||||
| 		t_name = '@0@-@1@-doc'.format(f_name, s_name) | ||||
| 
 | ||||
| 		# We do not really need an output file, but Meson | ||||
| 		# will complain if one is not set, so we use a | ||||
| 		# dummy 'stamp' file | ||||
| 		custom_target( | ||||
| 			t_name, | ||||
| 			command: [ | ||||
| 				gen_doxygen, | ||||
| 				# XXX pass doxygen path as argument | ||||
| 				'--builddir=@OUTDIR@', | ||||
| 				'--section=@0@'.format(s_name), | ||||
| 				'--output-format=@0@'.format(f_name), | ||||
| 				'--stamp=doc/doxygen/@0@.stamp'.format(t_name), | ||||
| 				wayland_doxygen, | ||||
| 				'@INPUT@', | ||||
| 			], | ||||
| 			input: s_files, | ||||
| 			output: '@0@.stamp'.format(t_name), | ||||
| 			depends: [dot_png, dot_map], | ||||
| 			build_by_default: true, | ||||
| 		) | ||||
| 	endforeach | ||||
| endforeach | ||||
| 
 | ||||
| man_files = shared_files + server_files + client_files | ||||
| custom_target( | ||||
| 	'man-pages-3', | ||||
| 	command: [ | ||||
| 		gen_doxygen, | ||||
| 		'--builddir=@OUTDIR@', | ||||
| 		'--output-format=man3', | ||||
| 		'--stamp=doc/doxygen/man3.stamp', | ||||
| 		wayland_doxygen, | ||||
| 		'@INPUT@', | ||||
| 	], | ||||
| 	input: man_files, | ||||
| 	output: 'man3', | ||||
| 	build_by_default: true, | ||||
| 	install: true, | ||||
| 	install_dir: join_paths(get_option('prefix'), get_option('mandir')), | ||||
| ) | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Emmanuele Bassi
						Emmanuele Bassi