diff options
author | David Robillard <d@drobilla.net> | 2020-11-11 12:34:13 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-11 12:34:31 +0100 |
commit | 3988cda6564cdb5a9bca91bc263bfbc7510b91b0 (patch) | |
tree | 1aa7fc9dd6856bca5fd3e5bbb79d843be73c1624 /wscript | |
parent | d822163cd48e00f54541567990a8b80ada85b3e3 (diff) | |
download | zix-3988cda6564cdb5a9bca91bc263bfbc7510b91b0.tar.gz zix-3988cda6564cdb5a9bca91bc263bfbc7510b91b0.tar.bz2 zix-3988cda6564cdb5a9bca91bc263bfbc7510b91b0.zip |
Add configure option to disable test malloc implementation
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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: |