aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/configure.ac
diff options
context:
space:
mode:
authorRechi <Rechi@users.noreply.github.com>2017-11-06 13:52:09 +0100
committerRechi <Rechi@users.noreply.github.com>2017-11-06 13:52:09 +0100
commit9255110a4556c282ac766fe20faf76cee9a85ab1 (patch)
tree1e7a258cfde965c7f1c43d4d6b0778ea965a9451 /tools/depends/configure.ac
parent31fbb3959e95a45976a5cfd1ea6f864912d470a7 (diff)
[darwin] debugging doesn't work in Xcode with -Og flag
Diffstat (limited to 'tools/depends/configure.ac')
-rw-r--r--tools/depends/configure.ac16
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac
index a1999e1f9d..c620fad418 100644
--- a/tools/depends/configure.ac
+++ b/tools/depends/configure.ac
@@ -651,11 +651,17 @@ tmp_cflags=$(echo $c11_flags $platform_cflags | sed 's/-O@<:@123@:>@//g;s/-g //g
tmp_cxxflags=$(echo $cxx11_flags $platform_cxxflags | sed 's/-O@<:@123@:>@//g;s/-g //g;s/ \{2,\}//g')
release_cflags="-DNDEBUG=1"
-CFLAGS="$tmp_cflags -Og -g -D_DEBUG"
-AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE([int foo;])],
- [debug_cflags="-Og -g -D_DEBUG"],
- [debug_cflags="-g -D_DEBUG"])
+
+# newer xcode version accept -Og flag, but debugging doesn't work with it
+if test "$platform_os" = "osx" || test "$platform_os" = "ios"; then
+ debug_cflags="-g -D_DEBUG"
+else
+ CFLAGS="$tmp_cflags -Og -g -D_DEBUG"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [debug_cflags="-Og -g -D_DEBUG"],
+ [debug_cflags="-g -D_DEBUG"])
+fi
# add user supplied flags to the end, so they override our defaults
platform_cflags_release="$tmp_cflags $relase_cflags $optimize_flags $passed_cflags"