Disable -optimize-debug for Clang

It results in Xcode outputting a warning when debugging:

  [app name] was compiled with optimization - stepping may behave oddly;
  variables may not be available.

And the warning is correct, debugging is broken in this situation.

Likely caused by Clang treating -Og as -O1:

  https://reviews.llvm.org/D24998

Change-Id: I25d6bf1e65c81cc5be92b9847f7d5dd6754a0177
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
Tor Arne Vestbø 2017-11-21 20:42:51 +01:00
parent f92aa8e931
commit 7ce71f0091
2 changed files with 3 additions and 3 deletions

View File

@ -82,7 +82,7 @@ Build options:
-debug-and-release ... Build two versions of Qt, with and without
debugging turned on [yes] (Apple and Windows only)
-optimize-debug ...... Enable debug-friendly optimizations in debug builds
[auto] (Not supported with MSVC)
[auto] (Not supported with MSVC or Clang toolchains)
-optimize-size ....... Optimize release builds for size instead of speed [no]
-optimized-tools ..... Build optimized host tools even in debug build [no]
-force-debug-info .... Create symbol files for release builds [no]

View File

@ -689,7 +689,7 @@
},
"optimize_debug": {
"label": "Optimize debug build",
"condition": "!config.msvc && (features.debug || features.debug_and_release) && tests.optimize_debug",
"condition": "!config.msvc && !config.clang && (features.debug || features.debug_and_release) && tests.optimize_debug",
"output": [ "privateConfig" ]
},
"optimize_size": {
@ -1312,7 +1312,7 @@ Configure with '-qreal float' to create a build that is binary-compatible with 5
{
"type": "feature",
"args": "optimize_debug",
"condition": "!config.msvc && (features.debug || features.debug_and_release)"
"condition": "!config.msvc && !config.clang && (features.debug || features.debug_and_release)"
},
{
"type": "feature",