Skip to content

Commit f3888d0

Browse files
Merge pull request #38 from lucaromagnoli/fix/windows-unique-ptr
fix: Windows compilation error with std::unique_ptr<void>
2 parents 06b78e8 + dd4bcca commit f3888d0

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ on:
77
- '**.md'
88
- 'docs/**'
99
- 'LICENSE'
10-
pull_request:
11-
branches: [ main, develop ]
12-
paths-ignore: # Skip CI for documentation changes
13-
- '**.md'
14-
- 'docs/**'
15-
- '.github/**'
16-
- 'LICENSE'
1710

1811
jobs:
1912
build-and-test:

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ FetchContent_Declare(
5050
GIT_TAG v0.15.3
5151
)
5252

53-
# Configure httplib to use OpenSSL
53+
# Configure httplib to use OpenSSL and disable unnecessary features
5454
set(HTTPLIB_USE_OPENSSL ON)
55+
set(HTTPLIB_USE_ZLIB OFF CACHE BOOL "" FORCE)
56+
set(HTTPLIB_USE_BROTLI OFF CACHE BOOL "" FORCE)
5557

5658
# Make dependencies available
5759
FetchContent_MakeAvailable(nlohmann_json httplib)
@@ -94,7 +96,7 @@ target_link_libraries(llmcpp
9496

9597
# Platform-specific libraries
9698
if(WIN32)
97-
target_link_libraries(llmcpp PRIVATE ws2_32 wsock32)
99+
target_link_libraries(llmcpp PRIVATE ws2_32 wsock32 crypt32)
98100
elseif(APPLE)
99101
target_link_libraries(llmcpp PRIVATE
100102
"-framework CoreFoundation"

src/openai/OpenAIHttpClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class OpenAIHttpClient::HttpClientImpl {
100100
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
101101
std::unique_ptr<httplib::SSLClient> client_;
102102
#else
103-
std::unique_ptr<void> client_; // Placeholder when SSL not available
103+
std::unique_ptr<httplib::Client> client_; // Use regular HTTP client when SSL not available
104104
#endif
105105
std::string hostname_;
106106
std::string basePath_;

0 commit comments

Comments
 (0)