From b22b504ea6ae7f764a8f05c808ea8033d1cafb9b Mon Sep 17 00:00:00 2001 From: hewenfei Date: Wed, 31 May 2023 14:55:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E7=94=A8qml=5Fdebug,=E6=9B=B4?= =?UTF-8?q?=E6=96=B0CmakeList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 10 ++-------- src/main.cpp | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f99538c..bf713b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,14 +169,8 @@ add_executable( ${SOURCE_FILES} ) -if (CMAKE_BUILD_TYPE) - string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE) - if (${BUILD_TYPE} STREQUAL "debug") - target_compile_definitions(${PROJECT_NAME} PRIVATE UKUI_MENU_LOG_FILE_DISABLE) - endif () -endif () - -target_compile_definitions(${PROJECT_NAME} PRIVATE $<$,$>:QT_QML_DEBUG>) +target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:UKUI_MENU_LOG_FILE_DISABLE>) +target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:QT_QML_DEBUG>) target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core diff --git a/src/main.cpp b/src/main.cpp index 45e2a0f..5ef597c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -119,8 +119,8 @@ void messageOutput(QtMsgType type, const QMessageLogContext &context, const QStr int main(int argc, char *argv[]) { startupTime = QDateTime::currentDateTime().toMSecsSinceEpoch(); - initLogFile(); #ifndef UKUI_MENU_LOG_FILE_DISABLE + initLogFile(); qInstallMessageHandler(messageOutput); #endif