mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	treewide: only define feature macros when the feature is available
Most feature checks already use #ifdef, and do not care about
the value of the macro. Convert all feature checks to do that,
and simplify the meson build scripts by replacing
  if cond
    cdata.set('X', 1)
  endif
with
  cdata.set('X', cond)
			
			
This commit is contained in:
		
							parent
							
								
									140378efd6
								
							
						
					
					
						commit
						15e7a61aa7
					
				
					 15 changed files with 49 additions and 83 deletions
				
			
		| 
						 | 
				
			
			@ -594,7 +594,7 @@ static bool device_supports_required_mSBC_transport_modes(
 | 
			
		|||
 | 
			
		||||
	/* Check if USB ALT6 is really available on the device */
 | 
			
		||||
	if (device->adapter->bus_type == BUS_TYPE_USB && !msbc_alt1_ok && msbc_ok) {
 | 
			
		||||
#if HAVE_LIBUSB
 | 
			
		||||
#ifdef HAVE_LIBUSB
 | 
			
		||||
		if (device->adapter->source_id == SOURCE_ID_USB) {
 | 
			
		||||
			msbc_ok = check_usb_altsetting_6(backend, device->adapter->vendor_id,
 | 
			
		||||
					device->adapter->product_id);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,24 +5,14 @@ foreach dep: bluez5_deps
 | 
			
		|||
  endif
 | 
			
		||||
endforeach
 | 
			
		||||
 | 
			
		||||
if not get_option('bluez5-backend-hsp-native').disabled()
 | 
			
		||||
  cdata.set('HAVE_BLUEZ_5_BACKEND_HSP_NATIVE', 1)
 | 
			
		||||
  cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE', 1)
 | 
			
		||||
endif
 | 
			
		||||
if not get_option('bluez5-backend-hfp-native').disabled()
 | 
			
		||||
  cdata.set('HAVE_BLUEZ_5_BACKEND_HFP_NATIVE', 1)
 | 
			
		||||
  cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE', 1)
 | 
			
		||||
endif
 | 
			
		||||
if not get_option('bluez5-backend-ofono').disabled()
 | 
			
		||||
  cdata.set('HAVE_BLUEZ_5_BACKEND_OFONO', 1)
 | 
			
		||||
endif
 | 
			
		||||
if not get_option('bluez5-backend-hsphfpd').disabled()
 | 
			
		||||
  cdata.set('HAVE_BLUEZ_5_BACKEND_HSPHFPD', 1)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
if dependency('bluez', version: '< 6', required: false).found()
 | 
			
		||||
  cdata.set('HAVE_BLUEZ_5_HCI', 1)
 | 
			
		||||
endif
 | 
			
		||||
cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE',
 | 
			
		||||
          not get_option('bluez5-backend-hsp-native').disabled() or
 | 
			
		||||
          not get_option('bluez5-backend-hfp-native').disabled())
 | 
			
		||||
cdata.set('HAVE_BLUEZ_5_BACKEND_HSP_NATIVE', not get_option('bluez5-backend-hsp-native').disabled())
 | 
			
		||||
cdata.set('HAVE_BLUEZ_5_BACKEND_HFP_NATIVE', not get_option('bluez5-backend-hfp-native').disabled())
 | 
			
		||||
cdata.set('HAVE_BLUEZ_5_BACKEND_OFONO', not get_option('bluez5-backend-ofono').disabled())
 | 
			
		||||
cdata.set('HAVE_BLUEZ_5_BACKEND_HSPHFPD', not get_option('bluez5-backend-hsphfpd').disabled())
 | 
			
		||||
cdata.set('HAVE_BLUEZ_5_HCI', dependency('bluez', version: '< 6', required: false).found())
 | 
			
		||||
 | 
			
		||||
bluez5_sources = [
 | 
			
		||||
  'plugin.c',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue