From d03ba0e895a3719ce527f3d7ee9262fb26065332 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 17 Nov 2016 15:01:59 +0100 Subject: Optimize debug builds when -Og is available Enables optimizing with -Og if GCC has the option available, this should produce faster debug binaries without compromising debugability. Is a privateConfig to limit it to the default Qt build. Includes two fixes for false positives of maybe_uninitialized triggered by -Og on gcc 4.9. Change-Id: I466d7a4070295714189024369312e6cbd36cfacf Reviewed-by: Oswald Buddenhagen --- configure.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'configure.json') diff --git a/configure.json b/configure.json index 4030d359ae..c293fbb676 100644 --- a/configure.json +++ b/configure.json @@ -93,6 +93,7 @@ "mp": { "type": "boolean", "name": "msvc_mp" }, "nomake": { "type": "addString", "values": [ "examples", "tests", "tools" ] }, "opensource": { "type": "void", "name": "commercial", "value": "no" }, + "optimize-debug": { "type": "boolean", "name": "optimize_debug" }, "optimized-qmake": { "type": "boolean", "name": "release_tools" }, "optimized-tools": { "type": "boolean", "name": "release_tools" }, "pch": { "type": "boolean", "name": "precompile_header" }, @@ -263,6 +264,11 @@ "type": "compilerSupportsFlag", "flag": "-fuse-ld=gold" }, + "optimize_debug": { + "label": "-Og support", + "type": "compilerSupportsFlag", + "flag": "-Og" + }, "enable_new_dtags": { "label": "new dtags support", "type": "linkerSupportsFlag", @@ -479,6 +485,11 @@ "condition": "!config.msvc && !config.integrity && tests.use_gold_linker", "output": [ "privateConfig", "useGoldLinker" ] }, + "optimize_debug": { + "label": "Optimize debug build", + "condition": "!config.msvc && (features.debug || features.debug_and_release) && tests.optimize_debug", + "output": [ "privateConfig" ] + }, "architecture": { "label": "Architecture", "output": [ "architecture" ] @@ -1078,6 +1089,11 @@ Configure with '-qreal float' to create a build that is binary-compatible with 5 "message": "Mode", "type": "buildMode" }, + { + "type": "feature", + "args": "optimize_debug", + "condition": "!config.msvc && (features.debug || features.debug_and_release)" + }, "shared", { "message": "Using C++ standard", -- cgit v1.2.3