Add switch for enabling debug symbols and logs

Enabling the switch on release builds will optimize the binaries as
normal, but will still include debug symbols. This is advantageous for
bugs that do not show up in debug builds without optimizations.
This commit is contained in:
Vasily
2020-01-15 14:01:47 +01:00
committed by username223
parent 5498424889
commit 016e5ebc4a
3 changed files with 20 additions and 1 deletions
+14 -1
View File
@@ -1,4 +1,9 @@
#include "setup.h"
#ifdef ENABLE_DEBUG_LOGGING
constexpr auto debugLoggingEnabled = true;
#else
constexpr auto debugLoggingEnabled = false;
#endif
// The default Qt message handler prints to stdout on X11 and to the debugger on
// Windows. That is borderline useless for us, therefore we create our own
@@ -317,7 +322,15 @@ void setUpLogging()
constexpr auto confDisabled = "false";
conf.set( Level::Trace, ConfigurationType::Enabled, confDisabled );
conf.set( Level::Debug, ConfigurationType::Enabled, confDisabled );
if constexpr ( debugLoggingEnabled )
{
conf.set( Level::Debug, ConfigurationType::Enabled, confEnabled );
}
else
{
conf.set( Level::Debug, ConfigurationType::Enabled, confDisabled );
}
const auto appDataLocation
= std::string( "/" ) + application_strings::applicationOrganizationName