Initial dstalk project: core DLL + CLI + BearSSL TLS
- Core DLL: AI API client (DeepSeek/OpenAI compatible), HTTP(S) via Boost.Beast - BearSSL vendored as TLS backend (MIT license, replacing OpenSSL) - CLI frontend with ANSI colors, /help /model /file /save /load commands - WinHTTP alternative HTTP client for Windows - GPLv3 license with linking exception - Build: CMake + Ninja + Clang, dependencies via Conan2 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
41
dstalk-core/CMakeLists.txt
Normal file
41
dstalk-core/CMakeLists.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
# ============================================================
|
||||
# dstalk-core — 核心 DLL
|
||||
# 包含: 网络通讯 / AI接口 / 文件读写
|
||||
# ============================================================
|
||||
|
||||
find_package(Boost CONFIG REQUIRED)
|
||||
find_package(OpenSSL CONFIG REQUIRED)
|
||||
|
||||
add_library(dstalk SHARED
|
||||
src/api.cpp
|
||||
src/file/file_io.cpp
|
||||
src/net/http_client.cpp
|
||||
src/ai/deepseek_api.cpp
|
||||
)
|
||||
|
||||
target_include_directories(dstalk
|
||||
PUBLIC include
|
||||
PRIVATE src
|
||||
)
|
||||
|
||||
target_link_libraries(dstalk
|
||||
PRIVATE
|
||||
Boost::boost
|
||||
Boost::system
|
||||
Boost::json
|
||||
OpenSSL::SSL
|
||||
OpenSSL::Crypto
|
||||
)
|
||||
|
||||
# 导出 DLL 符号宏
|
||||
target_compile_definitions(dstalk
|
||||
PRIVATE DSTALK_BUILD_DLL
|
||||
INTERFACE DSTALK_USE_DLL
|
||||
)
|
||||
|
||||
# Windows: 生成 .lib 导入库和 .dll
|
||||
if(WIN32)
|
||||
set_target_properties(dstalk PROPERTIES
|
||||
WINDOWS_EXPORT_ALL_SYMBOLS ON
|
||||
)
|
||||
endif()
|
||||
Reference in New Issue
Block a user