mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	meson.build: install symbolic links instead of compiling multiple times
Currently, among others, the `pipewire-pulse` executable is an exact copy of the `pipewire` executable. Use meson's `install_symlink()` to avoid the need for compiling the same thing multiple times. Also use `custom_target()` so that the aliases are available in an uninstalled environment. Do the same for `pw-cat`. The benefit is that all aliases of `pw-cat` are now available in an uninstalled environment. This commit increasese the minimum meson version to 0.61.1 as that is needed for `install_symlink()`. The reason for using 0.61.1 instead of 0.61.0 is the following bug: https://github.com/mesonbuild/meson/issues/9820
This commit is contained in:
		
							parent
							
								
									f3230ca2e6
								
							
						
					
					
						commit
						1ef43a5255
					
				
					 3 changed files with 32 additions and 29 deletions
				
			
		|  | @ -1,7 +1,7 @@ | ||||||
| project('pipewire', ['c' ], | project('pipewire', ['c' ], | ||||||
|   version : '0.3.67', |   version : '0.3.67', | ||||||
|   license : [ 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' ], |   license : [ 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' ], | ||||||
|   meson_version : '>= 0.59.0', |   meson_version : '>= 0.61.1', | ||||||
|   default_options : [ 'warning_level=3', |   default_options : [ 'warning_level=3', | ||||||
|                       'c_std=gnu11', |                       'c_std=gnu11', | ||||||
|                       'cpp_std=c++17', |                       'cpp_std=c++17', | ||||||
|  |  | ||||||
|  | @ -89,30 +89,7 @@ configure_file(input : 'pipewire.conf.in', | ||||||
| pipewire_exec = executable('pipewire', | pipewire_exec = executable('pipewire', | ||||||
|   pipewire_daemon_sources, |   pipewire_daemon_sources, | ||||||
|   install: true, |   install: true, | ||||||
|   c_args : pipewire_c_args, |   install_dir: pipewire_bindir, | ||||||
|   include_directories : [ configinc ], |  | ||||||
|   dependencies : [ spa_dep, pipewire_dep, ], |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| executable('pipewire-pulse', |  | ||||||
|   pipewire_daemon_sources, |  | ||||||
|   install: true, |  | ||||||
|   c_args : pipewire_c_args, |  | ||||||
|   include_directories : [ configinc ], |  | ||||||
|   dependencies : [ spa_dep, pipewire_dep, ], |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| executable('pipewire-avb', |  | ||||||
|   pipewire_daemon_sources, |  | ||||||
|   install: true, |  | ||||||
|   c_args : pipewire_c_args, |  | ||||||
|   include_directories : [ configinc ], |  | ||||||
|   dependencies : [ spa_dep, pipewire_dep, ], |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| executable('pipewire-aes67', |  | ||||||
|   pipewire_daemon_sources, |  | ||||||
|   install: true, |  | ||||||
|   c_args : pipewire_c_args, |   c_args : pipewire_c_args, | ||||||
|   include_directories : [ configinc ], |   include_directories : [ configinc ], | ||||||
|   dependencies : [ spa_dep, pipewire_dep, ], |   dependencies : [ spa_dep, pipewire_dep, ], | ||||||
|  | @ -120,6 +97,22 @@ executable('pipewire-aes67', | ||||||
| 
 | 
 | ||||||
| ln = find_program('ln') | ln = find_program('ln') | ||||||
| 
 | 
 | ||||||
|  | foreach alias : ['pipewire-pulse', 'pipewire-avb', 'pipewire-aes67'] | ||||||
|  |   custom_target( | ||||||
|  |     alias, | ||||||
|  |     build_by_default: true, | ||||||
|  |     install: false, | ||||||
|  |     command: [ln, '-sf', meson.project_build_root() + '/@INPUT@', '@OUTPUT@'], | ||||||
|  |     input: pipewire_exec, | ||||||
|  |     output: alias, | ||||||
|  |   ) | ||||||
|  |   install_symlink( | ||||||
|  |     alias, | ||||||
|  |     pointing_to: pipewire_exec.name(), | ||||||
|  |     install_dir: pipewire_bindir, | ||||||
|  |   ) | ||||||
|  | endforeach | ||||||
|  | 
 | ||||||
| custom_target('pipewire-uninstalled', | custom_target('pipewire-uninstalled', | ||||||
|   build_by_default: true, |   build_by_default: true, | ||||||
|   install: false, |   install: false, | ||||||
|  |  | ||||||
|  | @ -58,16 +58,26 @@ if get_option('pw-cat').allowed() and sndfile_dep.found() | ||||||
|     'pw-encplay', |     'pw-encplay', | ||||||
|   ] |   ] | ||||||
| 
 | 
 | ||||||
|   executable('pw-cat', |   pw_cat = executable('pw-cat', | ||||||
|     pwcat_sources, |     pwcat_sources, | ||||||
|     install: true, |     install: true, | ||||||
|     dependencies : [pwcat_deps, pipewire_dep, mathlib], |     dependencies : [pwcat_deps, pipewire_dep, mathlib], | ||||||
|   ) |   ) | ||||||
| 
 | 
 | ||||||
|   foreach alias : pwcat_aliases |   foreach alias : pwcat_aliases | ||||||
|     dst = pipewire_bindir / alias |     custom_target( | ||||||
|     cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pw-cat', dst) |       alias, | ||||||
|     meson.add_install_script('sh', '-c', cmd) |       build_by_default: true, | ||||||
|  |       install: false, | ||||||
|  |       command: [ln, '-sf', meson.project_build_root() + '/@INPUT@', '@OUTPUT@'], | ||||||
|  |       input: pw_cat, | ||||||
|  |       output: alias, | ||||||
|  |     ) | ||||||
|  |     install_symlink( | ||||||
|  |       alias, | ||||||
|  |       pointing_to: pw_cat.name(), | ||||||
|  |       install_dir: pipewire_bindir, | ||||||
|  |     ) | ||||||
|   endforeach |   endforeach | ||||||
| elif not sndfile_dep.found() and get_option('pw-cat').enabled() | elif not sndfile_dep.found() and get_option('pw-cat').enabled() | ||||||
|   error('pw-cat is enabled but required dependency `sndfile` was not found.') |   error('pw-cat is enabled but required dependency `sndfile` was not found.') | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Barnabás Pőcze
						Barnabás Pőcze