Files
dstalk/plugins_upper/ai_common/CMakeLists.txt
XiuChengWu 8faa02c3d5 W17: extract ai_common shared module + fix anthropic data race + brace bugs
- New plugins_upper/ai_common/ static library: shared PluginConfig, ToolCallAccum,
  StreamContext, secure_zero, extract_host_port, serialize_tool_calls, free_chat_result
- Refactored openai/anthropic plugins to use dstalk_ai:: namespace from ai_common
- Fixed anthropic g_config raw pointer → std::atomic (data race)
- Added SSE parse error counter with threshold abort (kMaxSseParseErrors=5)
- Fixed missing closing brace in both plugins' error-body catch block
- Updated test targets: ai_common include path + link, using namespace dstalk_ai
- plugin_loader_test: added stub_unreg + service_registry.cpp for unregister_service
- Includes pre-existing uncommitted changes from prior waves

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-31 16:58:25 +08:00

21 lines
535 B
CMake

# ============================================================
# ai_common — 共享 AI 插件工具库(静态库)/ Shared AI plugin utility library (static)
# ============================================================
find_package(Boost REQUIRED CONFIG)
add_library(ai_common STATIC
src/ai_common.cpp
)
target_include_directories(ai_common PUBLIC include)
target_compile_features(ai_common PUBLIC cxx_std_20)
target_link_libraries(ai_common
PUBLIC
dstalk
dstalk_boost_config
boost::boost
)