meson: add memory-alignment option

This commit is contained in:
Tim-Philipp Müller 2018-08-10 00:33:58 +01:00
parent d11450f238
commit fcbd110810
2 changed files with 12 additions and 2 deletions

View file

@ -74,14 +74,21 @@ cdata.set_quoted('PACKAGE_URL', '')
cdata.set_quoted('PACKAGE_VERSION', gst_version)
cdata.set_quoted('PLUGINDIR', join_paths(get_option('prefix'), get_option('libdir'), 'gstreamer-1.0'))
cdata.set_quoted('VERSION', gst_version)
# FIXME: --with-memory-alignment],[8,N,malloc,pagesize (default is 32)]) option
cdata.set('MEMORY_ALIGNMENT_MALLOC', 1)
cdata.set_quoted('GST_PLUGIN_SCANNER_INSTALLED', join_paths(prefix, helpers_install_dir, 'gst-plugin-scanner'))
cdata.set_quoted('GST_PTP_HELPER_INSTALLED', join_paths(prefix, helpers_install_dir, 'gst-ptp-helper'))
cdata.set_quoted('GST_PLUGIN_SCANNER_SUBDIR', libexecdir,
description: 'libexecdir path component, used to find plugin-scanner on relocatable builds on windows')
cdata.set('GST_DISABLE_OPTION_PARSING', not get_option('option-parsing'))
mem_align_opt = get_option('memory-alignment')
if mem_align_opt == 'malloc'
cdata.set('MEMORY_ALIGNMENT_MALLOC', 1)
elif mem_align_opt == 'pagesize'
cdata.set('MEMORY_ALIGNMENT_PAGESIZE', 1)
else
cdata.set('MEMORY_ALIGNMENT', mem_align_opt.to_int())
endif
if host_system == 'darwin'
cdata.set_quoted('GST_EXTRA_MODULE_SUFFIX', '.dylib')
endif

View file

@ -13,6 +13,9 @@ option('extra-checks', type : 'boolean', value : true, description : 'Enable ext
option('option-parsing', type : 'boolean', value : true,
description: 'Enable command line option parsing')
option('poisoning', type : 'boolean', value : false, description : 'Enable poisoning of deallocated objects')
option('memory-alignment', type: 'combo',
choices : ['1', '2', '4', '8', '16', '32', '64', '128', '256', '512', '1024', '2048', '4096', '8192', 'malloc', 'pagesize'],
value: 'malloc')
# Feature options
option('libunwind', type : 'feature', value : 'auto', description : 'Use libunwind to generate backtraces')