From 14be131c792911281225b3adc5d01b4dcc3960aa Mon Sep 17 00:00:00 2001
From: Pavel Cherenkov <pcherenkov@gmail.com>
Date: Mon, 2 Jul 2012 12:25:33 +0400
Subject: [PATCH] -ggdb changed to -g for clang builds

---
 CMakeLists.txt | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a6119fa20..a23dcd871b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -145,8 +145,14 @@ endif()
 #
 # Perform build type specific configuration.
 #
-set (CMAKE_C_FLAGS_DEBUG "-ggdb -O0 -fexceptions -funwind-tables")
-set (CMAKE_C_FLAGS_RELWITHDEBUGINFO "-ggdb -O2 -fexceptions -funwind-tables -DNDEBUG -DNVALGRIND")
+if (CMAKE_COMPILER_IS_GNUCC)
+    set (CC_DEBUG_OPT "-ggdb")
+else()
+    set (CC_DEBUG_OPT "-g")
+endif()
+
+set (CMAKE_C_FLAGS_DEBUG "${CC_DEBUG_OPT} -O0 -fexceptions -funwind-tables")
+set (CMAKE_C_FLAGS_RELWITHDEBUGINFO "${CC_DEBUG_OPT} -O2 -fexceptions -funwind-tables -DNDEBUG -DNVALGRIND")
 set (CMAKE_C_FLAGS_RELEASE "-DNDEBUG -DNVALGRIND")
 
 #
-- 
GitLab