From 618dbaaccdfafdf5e5decd7d2803cc599d4dd94a Mon Sep 17 00:00:00 2001 From: Jaeyun Date: Thu, 8 Aug 2019 14:58:25 +0900 Subject: [PATCH] [Meson] option to disable orc Add meson-option to disable orc library (default true). Set -Denable-orc=false if you need to block the orc library. Signed-off-by: Jaeyun Jung --- meson.build | 17 ++++++++++------- meson_options.txt | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 6072019..55fdae5 100644 --- a/meson.build +++ b/meson.build @@ -108,14 +108,17 @@ protobuf_dep = dependency('protobuf', version: '>= 3.6.1', required: false) # Orc have_orcc = false -orc_dep = dependency('orc-0.4', version: '>= 0.4.17', required: false) -orcc = find_program('orcc', required: false) -if orc_dep.found() and orcc.found() - have_orcc = true - orcc_args = [orcc, '--include', 'glib.h'] - add_project_arguments('-DHAVE_ORC=1', language: ['c', 'cpp']) +if get_option('enable-orc') + orc_dep = dependency('orc-0.4', version: '>= 0.4.17', required: true) + orcc = find_program('orcc', required: true) + if orc_dep.found() and orcc.found() + have_orcc = true + orcc_args = [orcc, '--include', 'glib.h'] + add_project_arguments('-DHAVE_ORC=1', language: ['c', 'cpp']) + else + error('Cannot find orc library') + endif else - message('Cannot find orc library') add_project_arguments('-DDISABLE_ORC=1', language: ['c', 'cpp']) endif diff --git a/meson_options.txt b/meson_options.txt index 90f9903..ebf8129 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,4 +1,5 @@ option('enable-test', type: 'boolean', value: true) +option('enable-orc', type: 'boolean', value: true) # default true, use orc when found orc library option('install-test', type: 'boolean', value: false) option('enable-tensorflow-lite', type: 'boolean', value: true) option('enable-tensorflow', type: 'boolean', value: true) -- 2.7.4