From c123d2ba4defc5541b39edb891edc555af836c53 Mon Sep 17 00:00:00 2001 From: ulmus-scott Date: Thu, 4 Nov 2021 00:10:09 -0400 Subject: [PATCH] enable optimization in configure --- mythtv/configure | 15 ++++++++++----- mythtv/libs/libmythbase/logging.cpp | 4 ++-- mythtv/programs/mythbackend/scheduler.cpp | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index f7327ca432d..b6225187f38 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -1996,8 +1996,6 @@ MYTHTV_CONFIG_LIST=' x11 libexiv2_external libbluray_external - profiletype - debugtype systemd_notify systemd_journal drm @@ -2100,6 +2098,7 @@ MYTHTV_PATHS_LIST=' ' MYTHTV_CMDLINE_SET=' + compile_type logging python qmake @@ -5144,16 +5143,20 @@ if test $target_os = android ; then fi append CCONFIG "$compile_type" -if test x$compile_type = x"profile" ; then +if test x$compile_type = x"release" ; then add_cflags -DNDEBUG add_cxxflags -DNDEBUG + check_cxxflags -O2 + enable debug +elif test x$compile_type = x"profile" ; then + add_cflags -DNDEBUG + add_cxxflags -DNDEBUG + check_cxxflags -O2 enable debug disable stripping - enable profiletype elif test x$compile_type = x"debug"; then enable debug disable optimizations stripping - enable debugtype fi enabled silent_cc && append CCONFIG "silent" @@ -7570,6 +7573,7 @@ QT_MIN_VERSION_HEX=$QT_MIN_VERSION_HEX QT_MIN_VERSION=$QT_MIN_VERSION MYTHTV_CONFIGURATION=$MYTHTV_CONFIGURATION MYTHTV_CONFIG_MAK=1 +COMPILE_TYPE=$compile_type PREFIX=$prefix prefix=$prefix LIBDIRNAME=$libdir_name @@ -7768,6 +7772,7 @@ cat > $TMPH <getTimestampUs(); char shortname = item->getLevelChar(); -#if CONFIG_DEBUGTYPE +#ifndef NDEBUG if (item->tid()) { line = qPrintable(QString("%1 %2 [%3/%4] %5 %6:%7:%8 %9\n") @@ -466,7 +466,7 @@ bool LoggerThread::logConsole(LoggingItem *item) const aprio = ANDROID_LOG_UNKNOWN; break; } -#if CONFIG_DEBUGTYPE +#ifndef NDEBUG __android_log_print(aprio, "mfe", "%s:%d:%s %s", qPrintable(item->m_file), item->m_line, qPrintable(item->m_function), qPrintable(item->m_message)); diff --git a/mythtv/programs/mythbackend/scheduler.cpp b/mythtv/programs/mythbackend/scheduler.cpp index 179c1a361e9..7a40bef35dc 100644 --- a/mythtv/programs/mythbackend/scheduler.cpp +++ b/mythtv/programs/mythbackend/scheduler.cpp @@ -611,9 +611,9 @@ void Scheduler::PrintRec(const RecordingInfo *p, const QString &prefix) // is included. Because PrintList is 1 character longer than // PrintRec, the output is off by 1 character. To compensate, // initialize outstr to 1 space in those cases. -#if CONFIG_DEBUGTYPE +#ifndef NDEBUG // debug compile type static QString initialOutstr = " "; -#else +#else // defined NDEBUG static QString initialOutstr = ""; #endif