3
0
Fork 0

Use old find_library to found ctpp2 lib if meson version < 0.31.0.

We need to support as far as possible the meson version installed on
ubuntu 16.04 (LTS).

In meson 0.31.0, the find_library has moved as a method of the compiler.
small_fixes
Matthieu Gautier 9 years ago
parent 2ca63541f2
commit 83768b176c

@ -17,11 +17,17 @@ if get_option('default_library') == 'static'
else else
libname = 'ctpp2' libname = 'ctpp2'
endif endif
find_library_in_compiler = meson.version().version_compare('>=0.31.0')
if ctpp2_prefix_install == '' if ctpp2_prefix_install == ''
if not compiler.has_header('ctpp2/CTPP2Logger.hpp') if not compiler.has_header('ctpp2/CTPP2Logger.hpp')
error('ctpp2/CTPP2Logger.hppnot found') error('ctpp2/CTPP2Logger.hppnot found')
endif endif
if find_library_in_compiler
ctpp2_lib = compiler.find_library(libname) ctpp2_lib = compiler.find_library(libname)
else
ctpp2_lib = find_library(libname)
endif
link_args = ['-l'+libname] link_args = ['-l'+libname]
if meson.is_cross_build() if meson.is_cross_build()
if host_machine.system() == 'windows' if host_machine.system() == 'windows'
@ -30,6 +36,9 @@ if ctpp2_prefix_install == ''
endif endif
ctpp2_dep = declare_dependency(link_args:link_args) ctpp2_dep = declare_dependency(link_args:link_args)
else else
if find_library_in_compiler
error('For custom ctpp2_prefix_install you need a meson version >=0.31.0')
endif
ctpp2_include_path = ctpp2_prefix_install + '/include' ctpp2_include_path = ctpp2_prefix_install + '/include'
ctpp2_include_args = ['-I'+ctpp2_include_path] ctpp2_include_args = ['-I'+ctpp2_include_path]
if not compiler.has_header('ctpp2/CTPP2Logger.hpp', args:ctpp2_include_args) if not compiler.has_header('ctpp2/CTPP2Logger.hpp', args:ctpp2_include_args)

Loading…
Cancel
Save