From 3988cda6564cdb5a9bca91bc263bfbc7510b91b0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 11 Nov 2020 12:34:13 +0100 Subject: Add configure option to disable test malloc implementation --- wscript | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index 802d415..1ae541c 100644 --- a/wscript +++ b/wscript @@ -28,6 +28,9 @@ def options(ctx): 'static': 'build static library'}) opt.add_option('--page-size', type='int', default=4096, dest='page_size', help='Page size for B-tree') + opt.add_option('--no-test-malloc', action='store_true', + dest='no_test_malloc', + help='Do not use test malloc implementation') def configure(conf): @@ -97,6 +100,11 @@ def configure(conf): if not conf.is_defined('HAVE_GLIB'): conf.fatal('Glib is required to build benchmarks') + if not (conf.env.DEST_OS == 'win32' or Options.options.no_test_malloc): + conf.env['ZIX_WITH_TEST_MALLOC'] = True + else: + conf.env['ZIX_WITH_TEST_MALLOC'] = False + conf.define('ZIX_VERSION', ZIX_VERSION) conf.define('ZIX_BTREE_PAGE_SIZE', Options.options.page_size) conf.write_config_header('zix-config.h', remove=False) @@ -204,10 +212,11 @@ def build(bld): cflags = test_cflags + ['-DZIX_INTERNAL'], linkflags = test_linkflags) - if bld.env.DEST_OS == 'win32': - test_malloc = [] - else: + if bld.env.ZIX_WITH_TEST_MALLOC: test_malloc = ['test/test_malloc.c'] + test_cflags += ['-DZIX_WITH_TEST_MALLOC'] + else: + test_malloc = [] # Unit test programs for i in tests: -- cgit v1.2.1