Meson: Check for dladdr with MinGW
authorMichel Zou <xantares09@hotmail.com>
Mon, 11 Nov 2019 21:14:55 +0000 (22:14 +0100)
committerMichel Zou <xantares09@hotmail.com>
Sat, 23 Nov 2019 11:01:11 +0000 (12:01 +0100)
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
meson.build

index 39907709f71d608744391dafe9aac013e0f0273c..69d15649060b61aa3a61ee6aeba3f18befe9790c 100644 (file)
@@ -1223,14 +1223,12 @@ ld_args_build_id = cc.get_supported_link_arguments('-Wl,--build-id=sha1')
 
 # check for dl support
 dep_dl = null_dep
-if host_machine.system() != 'windows'
-  if not cc.has_function('dlopen')
-    dep_dl = cc.find_library('dl')
-  endif
-  if cc.has_function('dladdr', dependencies : dep_dl)
-    # This is really only required for megadrivers
-    pre_args += '-DHAVE_DLADDR'
-  endif
+if not cc.has_function('dlopen')
+  dep_dl = cc.find_library('dl', required : host_machine.system() != 'windows')
+endif
+if cc.has_function('dladdr', dependencies : dep_dl)
+  # This is really only required for megadrivers
+  pre_args += '-DHAVE_DLADDR'
 endif
 
 if cc.has_function('dl_iterate_phdr')