build: Fix dependency objects for system libraries

The dependency checks for system libraries is not really portable.

Not all C standard libraries have separate rt and math libraries, so the
requirement should be set to false.

Additionally, finding threading libraries should be left to Meson
itself, using the `dependency('threads')` object, which will do the
right thing depending on platform and compiler.
This commit is contained in:
Emmanuele Bassi 2018-01-24 11:56:08 +00:00 committed by Wim Taymans
parent f9ed917814
commit d99f5defa3

View file

@ -141,10 +141,10 @@ configure_file(input : 'Makefile.in',
configuration : makedata) configuration : makedata)
# Find dependencies # Find dependencies
mathlib = cc.find_library('m', required : true) mathlib = cc.find_library('m', required : false)
rt_lib = cc.find_library('rt', required : true) # clock_gettime rt_lib = cc.find_library('rt', required : false) # clock_gettime
dl_lib = cc.find_library('dl', required : true) dl_lib = cc.find_library('dl', required : false)
pthread_lib = cc.find_library('pthread', required : true) pthread_lib = dependency('threads')
dbus_dep = dependency('dbus-1') dbus_dep = dependency('dbus-1')
#optional dependencies #optional dependencies