From: Olivier Matz Date: Thu, 7 Mar 2019 18:16:08 +0000 (+0100) Subject: fix meson build X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=bfc32eb38d93d86ce294ede5527bcbb34db5dd78;p=protos%2Flibecoli.git fix meson build --- 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)