This commit is contained in:
2026-04-11 16:11:16 +08:00
parent c7fee12291
commit 462f19f754
9 changed files with 428 additions and 44 deletions

29
cmake/log_emit.cmake Normal file
View File

@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.20)
if(NOT DEFINED NO_COLOR)
set(NO_COLOR 0)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/log.cmake")
if(NOT DEFINED LOG_LEVEL)
set(LOG_LEVEL "INFO")
endif()
if(NOT DEFINED LOG_TEXT)
set(LOG_TEXT "")
endif()
string(TOUPPER "${LOG_LEVEL}" _log_level)
if(_log_level STREQUAL "STEP")
cl_log_step("${LOG_TEXT}")
elseif(_log_level STREQUAL "INFO")
cl_log_info("${LOG_TEXT}")
elseif(_log_level STREQUAL "WARN")
cl_log_warn("${LOG_TEXT}")
elseif(_log_level STREQUAL "ERROR")
cl_log_error("${LOG_TEXT}")
else()
cl_log_info("${LOG_TEXT}")
endif()