diff options
author | Simon Ser <contact@emersion.fr> | 2019-10-08 19:30:49 +0300 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-10-16 09:01:27 -0400 |
commit | 21b75e5d1207e25ad8848e0b077c2754a5e9dc0b (patch) | |
tree | 80d5010eff323da1a5d7a39ae50a79e8289c8202 | |
parent | 480a31ea4e1a3aadbd053ee2a581cad5d4356876 (diff) |
build: simplify by using disabler deps
-rw-r--r-- | examples/meson.build | 35 | ||||
-rw-r--r-- | meson.build | 2 |
2 files changed, 11 insertions, 26 deletions
diff --git a/examples/meson.build b/examples/meson.build index 869384c2..4a6d1634 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -1,10 +1,10 @@ threads = dependency('threads') wayland_cursor = dependency('wayland-cursor') -libpng = dependency('libpng', required: false) +libpng = dependency('libpng', required: false, disabler: true) # These versions correspond to ffmpeg 4.0 -libavutil = dependency('libavutil', version: '>=56.14.100', required: false) -libavcodec = dependency('libavcodec', version: '>=58.18.100', required: false) -libavformat = dependency('libavformat', version: '>=58.12.100', required: false) +libavutil = dependency('libavutil', version: '>=56.14.100', required: false, disabler: true) +libavcodec = dependency('libavcodec', version: '>=58.18.100', required: false, disabler: true) +libavformat = dependency('libavformat', version: '>=58.12.100', required: false, disabler: true) # epoll is a separate library in FreeBSD if host_machine.system() == 'freebsd' @@ -13,13 +13,6 @@ else libepoll = [] endif -# Small hack until https://github.com/mesonbuild/meson/pull/3386/ is merged -foreach dep : ['libpng', 'libavutil', 'libavcodec', 'libavformat'] - if not get_variable(dep).found() - set_variable(dep, disabler()) - endif -endforeach - # Check if libavutil is found because of https://github.com/mesonbuild/meson/issues/6010 if libavutil.found() and not cc.has_header('libavutil/hwcontext_drm.h', dependencies: libavutil) libavutil = disabler() @@ -121,18 +114,10 @@ examples = { } foreach name, info : examples - all_dep_found = true - foreach d : info.get('dep') - all_dep_found = all_dep_found and d.found() - endforeach - if all_dep_found - executable( - name, - info.get('src'), - dependencies: info.get('dep'), - build_by_default: get_option('examples'), - ) - else - warning('Dependencies not satisfied for ' + name) - endif + executable( + name, + info.get('src'), + dependencies: info.get('dep'), + build_by_default: get_option('examples'), + ) endforeach diff --git a/meson.build b/meson.build index 3775e14c..473f49e3 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'c', version: '0.8.1', license: 'MIT', - meson_version: '>=0.48.0', + meson_version: '>=0.49.0', default_options: [ 'c_std=c11', 'warning_level=2', |