[geary] Remove non standard option DEBUG and use CMAKE_BUILD_TYPE instead. Bug 772879



commit b54a1484bc790d2dd4bb1229877f86b2779eef77
Author: Gautier Pelloux-Prayer <gautier+git damsy net>
Date:   Thu Oct 13 18:51:18 2016 +0200

    Remove non standard option DEBUG and use CMAKE_BUILD_TYPE instead. Bug 772879

 CMakeLists.txt     |    8 ++++++--
 configure          |    2 +-
 src/CMakeLists.txt |    8 --------
 3 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac379e7..f679f8b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,13 +54,17 @@ set(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME}-${VERSION})
 set(ARCHIVE_FULL_NAME ${ARCHIVE_BASE_NAME}.tar.xz)
 set(ARCHIVE_DEBUILD_FULL_NAME ${CMAKE_PROJECT_NAME}_${VERSION}.orig.tar.xz)
 
-option(DEBUG "Build for debugging." OFF)
+if (NOT CMAKE_BUILD_TYPE)
+  #default build is -O2 -g
+  set(CMAKE_BUILD_TYPE "RelWithDebInfo")
+endif()
+
 option(ICON_UPDATE "Run gtk-update-icon-cache after the install." ON)
 option(DESKTOP_UPDATE "Run update-desktop-database after the install." ON)
 option(DESKTOP_VALIDATE "Check generated desktop file for errors during build." ON)
 option(TRANSLATE_HELP "Generate and install translated help documentation." ON)
 
-if (DEBUG)
+IF(CMAKE_BUILD_TYPE MATCHES Debug)
     message(STATUS "Debug build")
 endif ()
 
diff --git a/configure b/configure
index a991cba..0d2b5ee 100755
--- a/configure
+++ b/configure
@@ -83,7 +83,7 @@ do
         --disable-silent-rules | --disable-static ) ;;
         
         --debug)
-                            CMDLINE="${CMDLINE} -DDEBUG=ON"
+                            CMDLINE="${CMDLINE} -DCMAKE_BUILD_TYPE=Debug"
                             ;;
         
         --disable-fatal-warnings)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6fe2957..d85e034 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -540,16 +540,8 @@ set(CFLAGS
     -DISO_CODE_639_XML=\"${ISO_CODE_639_XML}\"
     -DISO_CODE_3166_XML=\"${ISO_CODE_3166_XML}\"
     -DGCR_API_SUBJECT_TO_CHANGE
-    -g
 )
 
-if (NOT DEBUG)
-    set(CFLAGS
-        ${CFLAGS}
-        -O2
-    )    
-endif ()
-
 if (REF_TRACKING)
     message(STATUS "Reference tracking: ON")
     set(EXTRA_VALA_OPTIONS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]