From fcbd110810442c59687b6076b9b71d0c7ee18751 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 10 Aug 2018 00:33:58 +0100 Subject: [PATCH] meson: add memory-alignment option --- meson.build | 11 +++++++++-- meson_options.txt | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 834e15d..84a07b3 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/meson_options.txt b/meson_options.txt index cc34a20..fbb0a9c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') -- 2.7.4