From 317b13b56b5fe358bcc009c7bb4e78f577928507 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 17 Jan 2017 17:34:32 +0100 Subject: [PATCH] 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 --- meson.build | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 78a7a1863..22212358f 100644 --- a/meson.build +++ b/meson.build @@ -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 - ctpp2_lib = compiler.find_library(libname) + 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)