禁用qml_debug,更新CmakeList

This commit is contained in:
hewenfei 2023-05-31 14:55:13 +08:00 committed by He Sir
parent bb1f13c41a
commit b22b504ea6
2 changed files with 3 additions and 9 deletions

View File

@ -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 $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>:UKUI_MENU_LOG_FILE_DISABLE>)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>:QT_QML_DEBUG>)
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt5::Core

View File

@ -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