summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-11 12:34:13 +0100
committerDavid Robillard <d@drobilla.net>2020-11-11 12:34:31 +0100
commit3988cda6564cdb5a9bca91bc263bfbc7510b91b0 (patch)
tree1aa7fc9dd6856bca5fd3e5bbb79d843be73c1624 /wscript
parentd822163cd48e00f54541567990a8b80ada85b3e3 (diff)
downloadzix-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--wscript15
1 files changed, 12 insertions, 3 deletions
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: