perf: faster builds, leaner daemon, smoother install/run (0.9.20)

Reuse libcstcore.a for tests with -MMD incremental deps; idle-backoff the
parliament seat loop; defer curl init and cache settings; add systemd helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
WHC
2026-10-29 11:41:16 +08:00
co-authored by Cursor
parent 812e3ee265
commit 2f96b050d6
13 changed files with 278 additions and 103 deletions
+4 -8
View File
@@ -400,17 +400,13 @@ if(CST_BUILD_WEBUI)
list(APPEND _CST_CORE_TESTS test_webui)
endif()
foreach(t ${_CST_CORE_TESTS})
add_executable(${t} tests/${t}.c ${CST_CORE_SOURCES})
# The core now contains src/web_md.c, which needs sashidown's header and
# archive exactly like the Makefile build does.
# Link the shared cstcore archive instead of recompiling every core .c.
add_executable(${t} tests/${t}.c)
target_include_directories(${t} PRIVATE include "${CJSON_DIR}" "${SD_DIR}/include")
target_compile_definitions(${t} PRIVATE _GNU_SOURCE)
target_link_libraries(${t} PRIVATE
"${SASHIDOWN_A}" CURL::libcurl Threads::Threads)
target_link_libraries(${t} PRIVATE cstcore)
add_dependencies(${t} sashidown)
if(NOT WIN32)
target_link_libraries(${t} PRIVATE m)
else()
if(WIN32)
target_link_libraries(${t} PRIVATE ws2_32 crypt32 secur32 bcrypt advapi32 user32)
endif()
cst_win_exe(${t})