[krita] /: Replace the KritaDevs build type with a cmake option

Boudewijn Rempt null at kde.org
Wed Jul 25 15:26:35 BST 2018


Git commit 01b24dd68a093ba1448463d1c8dc2dd3cfad4c2c by Boudewijn Rempt.
Committed on 25/07/2018 at 12:42.
Pushed by rempt into branch 'master'.

Replace the KritaDevs build type with a cmake option

Qt5's cmake scripts check the build type, and for anything other
than Debug append -DQT_NO_DEBUG, which disables Q_ASSERT. We
want to build with optimizations (-O3 -g) and without QT_NO_DEBUG
when developing Krita, so we catch the asserts and still have
a realistic performance.

CCMAIL:kimageshop at kde.org

M  +6    -3    CMakeLists.txt

https://commits.kde.org/krita/01b24dd68a093ba1448463d1c8dc2dd3cfad4c2c

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c653572fcae..4ade41657d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,7 +61,7 @@ if (APPLE)
 endif()
 
 if (CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9 AND NOT WIN32)
-    add_definitions(-Werror=delete-incomplete)
+
 endif()
 
  ######################
@@ -305,7 +305,6 @@ include (MacroEnsureOutOfSourceBuild)
 macro_ensure_out_of_source_build("Compiling Krita inside the source directory is not possible. Please refer to the build instruction https://community.kde.org/Krita#Build_Instructions")
 
 
-
 # Note: OPTIONAL_COMPONENTS does not seem to be reliable
 # (as of ECM 5.15.0, CMake 3.2)
 
@@ -401,10 +400,14 @@ add_definitions(-DTRANSLATION_DOMAIN=\"krita\")
 # The reason for this mode is that the Debug mode disable inlining
 #
 if(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS_KRITADEVS "-O3 -g" CACHE STRING "" FORCE)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  -fext-numeric-literals")
 endif()
 
+option(KRITA_DEVS "For Krita developers. This modifies the DEBUG build type to use -O3 -g, while still enabling Q_ASSERT. This is necessary because the Qt5 cmake modules normally append QT_NO_DEBUG to any build type that is not labeled Debug")
+if (KRITA_DEVS)
+    set(CMAKE_CXX_FLAGS_DEBUG "-O3 -g" CACHE STRING "" FORCE)
+endif()
+
 if(UNIX)
     set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};m")
 endif()



More information about the kimageshop mailing list