From 58da9e761d7d3ea51730f3588e7db0a5d9c47754 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 1 May 2020 19:57:03 +0200 Subject: [PATCH] Add macro definitions to optionally compile random and meta in. --- subprojects/wren/meson.build | 13 +++++++++++++ subprojects/wren/meson_options.txt | 2 ++ 2 files changed, 15 insertions(+) diff --git a/subprojects/wren/meson.build b/subprojects/wren/meson.build index 1910874..b587790 100644 --- a/subprojects/wren/meson.build +++ b/subprojects/wren/meson.build @@ -5,6 +5,17 @@ project('wren', 'c', ) c_compiler = meson.get_compiler('c') +c_opts = [] +if get_option('wren_with_rand') + c_opts += '-DWREN_OPT_RANDOM=1' +else + c_opts += '-DWREN_OPT_RANDOM=0' +endif +if get_option('wren_with_meta') + c_opts += '-DWREN_OPT_META=1' +else + c_opts += '-DWREN_OPT_META=0' +endif wren_incl = include_directories('wren/src/include', is_system: true) wren_pvt_incl = include_directories('wren/src/vm', 'wren/src/optional') @@ -46,6 +57,7 @@ if force_static include_directories: [wren_incl, wren_pvt_incl], dependencies: [threads_dep, m_dep], install: not force_static, + c_args: c_opts, ) else wren = library(meson.project_name(), @@ -54,6 +66,7 @@ else include_directories: [wren_incl, wren_pvt_incl], dependencies: [threads_dep, m_dep], install: not force_static, + c_args: c_opts, ) endif wren_dep = declare_dependency( diff --git a/subprojects/wren/meson_options.txt b/subprojects/wren/meson_options.txt index 9e7a81f..1181c76 100644 --- a/subprojects/wren/meson_options.txt +++ b/subprojects/wren/meson_options.txt @@ -1,2 +1,4 @@ option('build_testing', type: 'boolean', value: false) option('wren_with_cli', type: 'boolean', value: true) +option('wren_with_rand', type: 'boolean', value: false) +option('wren_with_meta', type: 'boolean', value: false)