diff mbox series

[v3,1/7] build: enable debug info by default in meson builds

Message ID 20191129210905.1865-2-kevin.laatz@intel.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers show
Series Add ABI compatibility checks to the meson build | expand


Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Kevin Laatz Nov. 29, 2019, 9:08 p.m. UTC
From: Bruce Richardson <bruce.richardson@intel.com>

We can turn on debug info by default in meson builds, since it has no
performance penalty. This is done by changing the default build type from
"release" to "debugoptimized". Since the latter using O2, we can using
extra cflags to override that back to O3, which will make little real
difference for actual debugging.

For real debug builds, the user can still do "meson --buildtype=debug ..."
and to remove the debug info "meson --buildtype=release ..." can be used.
These are all standard meson options.

The advantage of having debug builds by default using meson settings is
that we can then add checks for ABI compatibility into each build, and
disable them if we detect that the user has turned off the debug info.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
 meson.build | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series


diff --git a/meson.build b/meson.build
index b7ae9c8d9..3b7a2e7de 100644
--- a/meson.build
+++ b/meson.build
@@ -7,10 +7,16 @@  project('DPDK', 'C',
 	version: run_command(find_program('cat', 'more'),
 	license: 'BSD',
-	default_options: ['buildtype=release', 'default_library=static'],
+	default_options: ['buildtype=debugoptimized',
+			'default_library=static'],
 	meson_version: '>= 0.47.1'
+# for default "debugoptimized" builds override optimization level 2 with 3
+if get_option('buildtype') == 'debugoptimized'
+	add_project_arguments('-O3', language: 'c')
 # set up some global vars for compiler, platform, configuration, etc.
 cc = meson.get_compiler('c')
 dpdk_conf = configuration_data()