From bfc32eb38d93d86ce294ede5527bcbb34db5dd78 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Thu, 7 Mar 2019 19:16:08 +0100 Subject: [PATCH] fix meson build --- examples/meson.build | 4 +++- examples/parse-yaml/meson.build | 4 ++++ meson.build | 12 +++++------- src/meson.build | 22 +++++++++++++++++++--- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/examples/meson.build b/examples/meson.build index 1435bfe..ff85cf6 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -2,4 +2,6 @@ # Copyright 2018, Olivier MATZ subdir('readline') -subdir('parse-yaml') +if get_option('with_yaml') and get_option('with_editline') + subdir('parse-yaml') +endif diff --git a/examples/parse-yaml/meson.build b/examples/parse-yaml/meson.build index 118fdc3..d6605c9 100644 --- a/examples/parse-yaml/meson.build +++ b/examples/parse-yaml/meson.build @@ -13,3 +13,7 @@ ecoli_parse_yaml = executable( include_directories : inc, link_with : libecoli, dependencies: [yaml_dep, edit_dep]) + +install_data( + 'parse-yaml.sh', + install_dir : get_option('bindir')) diff --git a/meson.build b/meson.build index dee9cb6..75b1ee0 100644 --- a/meson.build +++ b/meson.build @@ -4,17 +4,15 @@ project('libecoli', 'c', version : '0.1', - license : 'BSD-3-clause') - -# if debug -add_global_arguments('-Wall', language : 'c') -add_global_arguments('-Werror', language : 'c') -add_global_arguments('-W', language : 'c') -add_global_arguments('-Wextra', language : 'c') + license : 'BSD-3-clause', + default_options: ['warning_level=2']) edit_dep = dependency('libedit', method: 'pkg-config') yaml_dep = dependency('yaml-0.1', method: 'pkg-config') +# XXX if debug +add_global_arguments('-Werror', language : 'c') + subdir('src') subdir('test') subdir('examples') diff --git a/src/meson.build b/src/meson.build index 4c9860f..cdbed7b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -7,7 +7,6 @@ libecoli_sources = [ 'ecoli_assert.c', 'ecoli_complete.c', 'ecoli_config.c', - 'ecoli_editline.c', 'ecoli_init.c', 'ecoli_keyval.c', 'ecoli_log.c', @@ -41,10 +40,27 @@ libecoli_sources = [ 'ecoli_strvec.c', 'ecoli_test.c', 'ecoli_vec.c', - 'ecoli_yaml.c', ] +deps = [] +if get_option('with_yaml') + libecoli_sources += [ + 'ecoli_yaml.c', + ] + deps += [ + yaml_dep, + ] +endif +if get_option('with_editline') + libecoli_sources += [ + 'ecoli_editline.c', + ] + deps += [ + edit_dep, + ] +endif + libecoli = shared_library('ecoli', libecoli_sources, include_directories : inc, - dependencies : [edit_dep, yaml_dep], + dependencies : deps, install : true) -- 2.20.1