mirror of https://github.com/kiwix/libkiwix.git
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. Fix #10
This commit is contained in:
parent
88f6b3a0f9
commit
317b13b56b
|
@ -16,11 +16,17 @@ if get_option('default_library') == 'static'
|
|||
else
|
||||
libname = 'ctpp2'
|
||||
endif
|
||||
|
||||
find_library_in_compiler = meson.version().version_compare('>=0.31.0')
|
||||
if ctpp2_prefix_install == ''
|
||||
if not compiler.has_header('ctpp2/CTPP2Logger.hpp')
|
||||
error('ctpp2/CTPP2Logger.hppnot found')
|
||||
endif
|
||||
if find_library_in_compiler
|
||||
ctpp2_lib = compiler.find_library(libname)
|
||||
else
|
||||
ctpp2_lib = find_library(libname)
|
||||
endif
|
||||
link_args = ['-l'+libname]
|
||||
if meson.is_cross_build()
|
||||
if host_machine.system() == 'windows'
|
||||
|
@ -29,6 +35,9 @@ if ctpp2_prefix_install == ''
|
|||
endif
|
||||
ctpp2_dep = declare_dependency(link_args:link_args)
|
||||
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_args = ['-I'+ctpp2_include_path]
|
||||
if not compiler.has_header('ctpp2/CTPP2Logger.hpp', args:ctpp2_include_args)
|
||||
|
|
Loading…
Reference in New Issue