diff options
| author | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2019-05-21 12:36:01 +0300 |
|---|---|---|
| committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2019-05-23 15:14:08 +0300 |
| commit | 736b099862f61b115b3845309b860cb66915fe2a (patch) | |
| tree | 41dd86b1a58178349c305245e53950754efda2c7 /runner | |
| parent | 29cb27e662948b1d0710e9fdaceb5bb221746ff8 (diff) | |
meson: Start using 'feature' options
Meson 0.47 comes with a new type of option called 'feature' so instead of:
type : 'combo',
value : 'auto',
choices : ['auto', 'true', 'false'],
We can:
type : 'feature',
The main difference is that the feature takes auto, enabled and disabled
instead of auto, true and false.
get_option() on a feature returns opaque object that can be passed as
a 'required' argument of a dependency. Auto is equivalent to 'required
: false', enabled is equivalent to 'required : true' and disabled
introduces new behavior forcing the dependency to be considered not
found.
This allows us to streamline a lot of logic regarding optional IGT
features.
This patch bumps required meson version to 0.47.0
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Simon Ser <simon.ser@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'runner')
| -rw-r--r-- | runner/meson.build | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/runner/meson.build b/runner/meson.build index b658f1d2..4eff193a 100644 --- a/runner/meson.build +++ b/runner/meson.build @@ -1,4 +1,4 @@ -jsonc = dependency('json-c', required: _runner_required) +build_runner = get_option('build_runner') runnerlib_sources = [ 'settings.c', 'job_list.c', @@ -12,11 +12,13 @@ results_sources = [ 'results.c' ] runner_test_sources = [ 'runner_tests.c' ] runner_json_test_sources = [ 'runner_json_tests.c' ] -if not _build_tests and _runner_required +jsonc = dependency('json-c', required: build_runner) + +if not build_tests and jsonc.found() error('Building test runner requires building tests') endif -if _build_runner and _build_tests and jsonc.found() +if jsonc.found() subdir('testdata') runnerlib = static_library('igt_runner', runnerlib_sources, @@ -58,7 +60,7 @@ if _build_runner and _build_tests and jsonc.found() dependencies : [igt_deps, jsonc]) test('runner_json', runner_json_test) - build_info += 'Build test runner: Yes' + build_info += 'Build test runner: true' else - build_info += 'Build test runner: No' + build_info += 'Build test runner: false' endif |
