fix meson build
authorOlivier Matz <zer0@droids-corp.org>
Thu, 7 Mar 2019 18:16:08 +0000 (19:16 +0100)
committerOlivier Matz <zer0@droids-corp.org>
Thu, 7 Mar 2019 18:16:08 +0000 (19:16 +0100)
examples/meson.build
examples/parse-yaml/meson.build
meson.build
src/meson.build

index 1435bfe..ff85cf6 100644 (file)
@@ -2,4 +2,6 @@
 # Copyright 2018, Olivier MATZ <zer0@droids-corp.org>
 
 subdir('readline')
-subdir('parse-yaml')
+if get_option('with_yaml') and get_option('with_editline')
+       subdir('parse-yaml')
+endif
index 118fdc3..d6605c9 100644 (file)
@@ -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'))
index dee9cb6..75b1ee0 100644 (file)
@@ -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')
index 4c9860f..cdbed7b 100644 (file)
@@ -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)