From 387b6df948a566ca8d6318b58029f66499ffb1c2 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 3 Apr 2020 17:07:47 +0530 Subject: [PATCH] meson: Don't use get_option('buildtype') We should directly check the values of the `debug` and `optimization` options instead. `get_option('buildtype')` will return `'custom'` for most combinations of `-Doptimization` and `-Ddebug`, but those two will always be set correctly if only `-Dbuildtype` is set. So we should look at those options directly. For the two-way mapping between `buildtype` and `optimization` + `debug`, see this table: https://mesonbuild.com/Builtin-options.html#build-type-options --- ext/vulkan/shaders/meson.build | 7 +++---- meson.build | 2 +- sys/d3d11/meson.build | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ext/vulkan/shaders/meson.build b/ext/vulkan/shaders/meson.build index f822dd0eb5..6048f631e7 100644 --- a/ext/vulkan/shaders/meson.build +++ b/ext/vulkan/shaders/meson.build @@ -18,17 +18,16 @@ bin2array = find_program('bin2array.py') # FIXME: meson compiler class instead? glslc_build_options = [] optimization = get_option('optimization') -buildtype = get_option('buildtype') -if get_option('debug') or optimization == 'g' or ['debug', 'debugoptimized'].contains(buildtype) +if get_option('debug') glslc_build_options += ['-g'] endif if get_option('werror') glslc_build_options += ['-Werror'] endif -if buildtype == 'minsize' or optimization == 's' +if optimization == 's' glslc_build_options += ['-Os'] endif -if ['release', 'debugoptimized'].contains(buildtype) or ['1', '2', '3'].contains(optimization) +if optimization in ['1', '2', '3'] glslc_build_options += ['-O'] endif diff --git a/meson.build b/meson.build index 92b271025e..5f992891b0 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('gst-plugins-bad', 'c', 'cpp', version : '1.17.0.1', - meson_version : '>= 0.48', + meson_version : '>= 0.49', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ]) diff --git a/sys/d3d11/meson.build b/sys/d3d11/meson.build index 53f1b71a4c..dad075c94d 100644 --- a/sys/d3d11/meson.build +++ b/sys/d3d11/meson.build @@ -86,7 +86,7 @@ if not have_d3d11 endif # for enabling debug layer -if get_option('buildtype').startswith('debug') +if get_option('debug') d3d11_debug_libs = [ ['d3d11sdklayers.h', 'ID3D11Debug', 'ID3D11InfoQueue', 'have_d3d11sdk_h'], ['dxgidebug.h', 'IDXGIDebug', 'IDXGIInfoQueue', 'have_dxgidebug_h'], -- 2.34.1