From 934735822aa78ff11994c0ed122b42cf0411d18a Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 11 Jan 2023 20:22:14 +0100 Subject: [PATCH] Set GenerateDebugInformation to true in vcproj if at least /DEBUG is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the command line option contains /DEBUG without the following argument, GenerateDebugInformation remained 'false' because the DebugInfoOption contained the initial value. Set GenerateDebugInformation to 'true' if the /DEBUG option is found and reset to 'false' only if option is set to 'none'. Amends commit 6a6b27940d497b29672ff65ff242fe0211603f22. Fixes: QTBUG-110068 Change-Id: I792d7335d8b9536d4beed54cabfd70dcf54f09ac Reviewed-by: Alexey Edelev Reviewed-by: Jörg Bornemann (cherry picked from commit 0e3ef4111271761ede6cbbeb3b0fa075a483085e) Reviewed-by: Qt Cherry-pick Bot --- qmake/generators/win32/msvc_objectmodel.cpp | 3 ++- qmake/generators/win32/msvc_objectmodel.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 58786868288..b5639c01084 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -1478,7 +1478,8 @@ bool VCLinkerTool::parseOption(const char* option) EnableUAC = _True; break; case 0x3389797: // /DEBUG[:{FASTLINK|FULL|NONE}] - if (config->CompilerVersion >= NET2015) { + DebugInfoOption = linkerDebugOptionEnabled; + if (config->CompilerVersion >= NET2015 && *(option + 6) == ':') { const char *str = option + 7; if (qstricmp(str, "fastlink") == 0) DebugInfoOption = linkerDebugOptionFastLink; diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index f0869d510f8..190d6c727fa 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -258,6 +258,7 @@ enum inlineExpansionOption { }; enum linkerDebugOption { linkerDebugOptionNone, + linkerDebugOptionEnabled, // represents /DEBUG without further options linkerDebugOptionFastLink, linkerDebugOptionFull };