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