meson: handle missing xkbcomp.pc better
Applying get_pkgconfig_variable() to a not-found dependency was always documented as an error, but meson 0.49 now actually raises an error[1]: meson.build:110:4: ERROR: 'xkbcomp' is not a pkgconfig dependency Check xkbcomp_dep is a suitable dependency type before applying get_pkgconfig_variable() to it. [1] but this is more by accident than design (see the discusssion at [2] et seq.), so who knows where things will come to rest... [2] https://github.com/mesonbuild/meson/pull/4444#issuecomment-442443301
This commit is contained in:
		
							parent
							
								
									ef91da2757
								
							
						
					
					
						commit
						f3567600cf
					
				| 
						 | 
					@ -107,7 +107,9 @@ build_hashtable = false
 | 
				
			||||||
# Resolve default values of some options
 | 
					# Resolve default values of some options
 | 
				
			||||||
xkb_dir = get_option('xkb_dir')
 | 
					xkb_dir = get_option('xkb_dir')
 | 
				
			||||||
if xkb_dir == ''
 | 
					if xkb_dir == ''
 | 
				
			||||||
 | 
					    if xkbcomp_dep.found() and xkbcomp_dep.type_name() == 'pkgconfig'
 | 
				
			||||||
        xkb_dir = xkbcomp_dep.get_pkgconfig_variable('xkbconfigdir')
 | 
					        xkb_dir = xkbcomp_dep.get_pkgconfig_variable('xkbconfigdir')
 | 
				
			||||||
 | 
					    endif
 | 
				
			||||||
    if xkb_dir == ''
 | 
					    if xkb_dir == ''
 | 
				
			||||||
        xkb_dir = join_paths(get_option('prefix'), 'share/X11/xkb')
 | 
					        xkb_dir = join_paths(get_option('prefix'), 'share/X11/xkb')
 | 
				
			||||||
    endif
 | 
					    endif
 | 
				
			||||||
| 
						 | 
					@ -120,7 +122,9 @@ endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
xkb_bin_dir = get_option('xkb_bin_dir')
 | 
					xkb_bin_dir = get_option('xkb_bin_dir')
 | 
				
			||||||
if xkb_bin_dir == ''
 | 
					if xkb_bin_dir == ''
 | 
				
			||||||
 | 
					    if xkbcomp_dep.found() and xkbcomp_dep.type_name() == 'pkgconfig'
 | 
				
			||||||
        xkb_bin_dir = xkbcomp_dep.get_pkgconfig_variable('bindir')
 | 
					        xkb_bin_dir = xkbcomp_dep.get_pkgconfig_variable('bindir')
 | 
				
			||||||
 | 
					    endif
 | 
				
			||||||
    if xkb_bin_dir == ''
 | 
					    if xkb_bin_dir == ''
 | 
				
			||||||
        xkb_bin_dir = join_paths(get_option('prefix'), get_option('bindir'))
 | 
					        xkb_bin_dir = join_paths(get_option('prefix'), get_option('bindir'))
 | 
				
			||||||
    endif
 | 
					    endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue