Core: add configurable startup log rotation

This commit is contained in:
faumaray committed 2026-07-28 21:10:09 +03:00
1 parent a277f2102b
commit 9637f1eef7
9 files changed
+361 -27

No files matched your search

+22 -1
View File
@@ -1,5 +1,11 @@
cmake_minimum_required(VERSION 4.0.0)
project(EchoionCore VERSION 1.0.0 LANGUAGES CXX)
if(NOT DEFINED ECHOION_PRODUCT_VERSION)
set(ECHOION_PRODUCT_VERSION 0.0.0)
endif()
if(NOT DEFINED ECHOION_COMPONENT_VERSION)
set(ECHOION_COMPONENT_VERSION "${ECHOION_PRODUCT_VERSION}")
endif()
project(EchoionCore VERSION "${ECHOION_PRODUCT_VERSION}" LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -11,6 +17,8 @@ file(GLOB_RECURSE CORE_SOURCES
"src/**.cpp"
)
add_library(EchoionCore SHARED ${CORE_SOURCES})
target_compile_definitions(EchoionCore PRIVATE
ECHOION_CORE_VERSION="${ECHOION_COMPONENT_VERSION}")
add_library(Echoion::Core ALIAS EchoionCore)
@@ -150,6 +158,19 @@ else()
target_compile_options(EchoionCore PRIVATE -Wall -Wextra -Wpedantic)
endif()
if(BUILD_TESTS)
add_executable(echoion_log_rotation_tests
tests/test_log_rotation.cpp
src/LogRotation.cpp
)
target_include_directories(echoion_log_rotation_tests PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/include"
)
target_compile_features(echoion_log_rotation_tests PRIVATE cxx_std_26)
add_test(NAME echoion_log_rotation_tests
COMMAND echoion_log_rotation_tests)
endif()
# Precompiled headers for the heavy translation units (MusicManager.cpp ~2.4k
# lines, Core.cpp, YouTubeClient.cpp). These pull in the same expensive standard
# and Void headers, so compiling them once cuts a large slice off build time.