From 1456b8091a681316f0e6256554fd138c6399f564 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 12 Sep 2019 10:27:16 +0200 Subject: Make it possible to undefine NDEBUG for nmake and VS projects For nmake and VS projects we added the NDEBUG define for the release configuration unconditionally within the qmake generators. To undefine it, users had to use a nasty work-around. Now, define NDEBUG within the MSVC mkspecs. In order to do that we introduce the DEFINES_RELEASE and DEFINES_DEBUG variables that are merged into DEFINES in default_pre.prf. Users can unset NDEBUG by writing DEFINES -= NDEBUG in their .pro file. Note that DEFINES_RELEASE and DEFINES_DEBUG are merged in default_pre.prf in order to give extra compilers (like moc) the chance to see the fully resolved DEFINES variable. This is different from the QMAKE_CFLAGS_(DEBUG|RELEASE) variables that get merged in default_post.prf. Fixes: QTBUG-78071 Change-Id: I381770a1d2f974fbae9b09a2254e3f2fc7842b68 Reviewed-by: Kai Koehne --- qmake/generators/win32/msvc_nmake.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'qmake/generators/win32/msvc_nmake.cpp') diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 63d89a5388..fd90cfcb2a 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -281,10 +281,6 @@ void NmakeMakefileGenerator::init() if (project->isActiveConfig("debug")) { project->values("QMAKE_CLEAN").append(targetBase + ".ilk"); project->values("QMAKE_CLEAN").append(targetBase + ".idb"); - } else { - ProStringList &defines = project->values("DEFINES"); - if (!defines.contains("NDEBUG")) - defines.append("NDEBUG"); } if (project->values("QMAKE_APP_FLAG").isEmpty() && project->isActiveConfig("dll")) { -- cgit v1.2.3