fix: Windows build compatibility - disable OpenSSL and fix Winsock linking
- Remove hardcoded CPPHTTPLIB_OPENSSL_SUPPORT in HttpClient.hpp - Make SSL certificate verification conditional on OpenSSL availability - Add ws2_32 (Winsock) linking for all targets using httplib on Windows - Disable TestRunnerModule on Windows (requires Unix dlfcn.h) - Fix .gitignore to exclude GroveEngine symlink (local only) - Disable httplib OpenSSL auto-detection when OpenSSL not found This enables AISSIA to build successfully on Windows without OpenSSL, using HTTP-only mode for LLM API calls. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
099e0d837e
commit
f5c03e1343
7
.gitignore
vendored
7
.gitignore
vendored
@ -64,7 +64,12 @@ Thumbs.db
|
|||||||
*.mov
|
*.mov
|
||||||
*.wmv
|
*.wmv
|
||||||
*.mp3
|
*.mp3
|
||||||
*.wavbuild/
|
*.wav
|
||||||
|
|
||||||
|
# Symlink to GroveEngine (local only)
|
||||||
|
external/GroveEngine
|
||||||
|
|
||||||
|
build/
|
||||||
*.o
|
*.o
|
||||||
*.a
|
*.a
|
||||||
*.so
|
*.so
|
||||||
|
|||||||
@ -42,6 +42,12 @@ endif()
|
|||||||
|
|
||||||
# cpp-httplib (header-only HTTP client)
|
# cpp-httplib (header-only HTTP client)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
|
# Disable OpenSSL auto-detection in httplib if OpenSSL is not available
|
||||||
|
if(NOT OPENSSL_FOUND)
|
||||||
|
set(HTTPLIB_USE_OPENSSL_IF_AVAILABLE OFF CACHE BOOL "Disable OpenSSL in httplib" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
httplib
|
httplib
|
||||||
GIT_REPOSITORY https://github.com/yhirose/cpp-httplib.git
|
GIT_REPOSITORY https://github.com/yhirose/cpp-httplib.git
|
||||||
@ -68,6 +74,10 @@ target_link_libraries(AissiaLLM PUBLIC
|
|||||||
GroveEngine::impl
|
GroveEngine::impl
|
||||||
spdlog::spdlog
|
spdlog::spdlog
|
||||||
)
|
)
|
||||||
|
# Link Winsock for httplib on Windows
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(AissiaLLM PUBLIC ws2_32)
|
||||||
|
endif()
|
||||||
if(OPENSSL_FOUND)
|
if(OPENSSL_FOUND)
|
||||||
target_link_libraries(AissiaLLM PUBLIC OpenSSL::SSL OpenSSL::Crypto)
|
target_link_libraries(AissiaLLM PUBLIC OpenSSL::SSL OpenSSL::Crypto)
|
||||||
target_compile_definitions(AissiaLLM PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
|
target_compile_definitions(AissiaLLM PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
|
||||||
@ -119,13 +129,16 @@ target_include_directories(AissiaAudio PUBLIC
|
|||||||
target_link_libraries(AissiaAudio PUBLIC
|
target_link_libraries(AissiaAudio PUBLIC
|
||||||
spdlog::spdlog
|
spdlog::spdlog
|
||||||
)
|
)
|
||||||
|
# Link Winsock for httplib on Windows
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(AissiaAudio PUBLIC ws2_32 sapi ole32)
|
||||||
|
endif()
|
||||||
if(OPENSSL_FOUND)
|
if(OPENSSL_FOUND)
|
||||||
target_link_libraries(AissiaAudio PUBLIC OpenSSL::SSL OpenSSL::Crypto)
|
target_link_libraries(AissiaAudio PUBLIC OpenSSL::SSL OpenSSL::Crypto)
|
||||||
target_compile_definitions(AissiaAudio PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
|
target_compile_definitions(AissiaAudio PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
|
||||||
endif()
|
endif()
|
||||||
if(WIN32)
|
# Note: Si OpenSSL n'est pas trouvé, on ne définit PAS CPPHTTPLIB_OPENSSL_SUPPORT
|
||||||
target_link_libraries(AissiaAudio PUBLIC sapi ole32)
|
# httplib utilisera HTTP simple sans SSL
|
||||||
endif()
|
|
||||||
|
|
||||||
# Optional: Link Vosk if available (Phase 7 STT)
|
# Optional: Link Vosk if available (Phase 7 STT)
|
||||||
find_library(VOSK_LIBRARY vosk)
|
find_library(VOSK_LIBRARY vosk)
|
||||||
@ -300,6 +313,10 @@ target_link_libraries(WebModule PRIVATE
|
|||||||
GroveEngine::impl
|
GroveEngine::impl
|
||||||
spdlog::spdlog
|
spdlog::spdlog
|
||||||
)
|
)
|
||||||
|
# Link Winsock for httplib on Windows
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(WebModule PRIVATE ws2_32)
|
||||||
|
endif()
|
||||||
if(OPENSSL_FOUND)
|
if(OPENSSL_FOUND)
|
||||||
target_link_libraries(WebModule PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
target_link_libraries(WebModule PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||||
target_compile_definitions(WebModule PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
|
target_compile_definitions(WebModule PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
|
||||||
@ -319,26 +336,35 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/config/
|
|||||||
# Development targets
|
# Development targets
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
# TestRunnerModule - Orchestrator for integration tests
|
# TestRunnerModule - Orchestrator for integration tests (Unix only - uses dlfcn.h)
|
||||||
add_library(TestRunnerModule SHARED
|
if(UNIX)
|
||||||
src/modules/TestRunnerModule.cpp
|
add_library(TestRunnerModule SHARED
|
||||||
)
|
src/modules/TestRunnerModule.cpp
|
||||||
target_include_directories(TestRunnerModule PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
)
|
||||||
target_link_libraries(TestRunnerModule PRIVATE
|
target_include_directories(TestRunnerModule PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
GroveEngine::impl
|
target_link_libraries(TestRunnerModule PRIVATE
|
||||||
spdlog::spdlog
|
GroveEngine::impl
|
||||||
${CMAKE_DL_LIBS}
|
spdlog::spdlog
|
||||||
)
|
${CMAKE_DL_LIBS}
|
||||||
set_target_properties(TestRunnerModule PROPERTIES
|
)
|
||||||
PREFIX "lib"
|
set_target_properties(TestRunnerModule PROPERTIES
|
||||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/modules
|
PREFIX "lib"
|
||||||
)
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/modules
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Quick rebuild of modules only (for hot-reload workflow)
|
# Quick rebuild of modules only (for hot-reload workflow)
|
||||||
add_custom_target(modules
|
if(UNIX)
|
||||||
DEPENDS SchedulerModule NotificationModule StorageModule MonitoringModule AIModule VoiceModule WebModule TestRunnerModule
|
add_custom_target(modules
|
||||||
COMMENT "Building hot-reloadable modules only"
|
DEPENDS SchedulerModule NotificationModule StorageModule MonitoringModule AIModule VoiceModule WebModule TestRunnerModule
|
||||||
)
|
COMMENT "Building hot-reloadable modules only"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_custom_target(modules
|
||||||
|
DEPENDS SchedulerModule NotificationModule StorageModule MonitoringModule AIModule VoiceModule WebModule
|
||||||
|
COMMENT "Building hot-reloadable modules only"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Create data directory
|
# Create data directory
|
||||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/data)
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/data)
|
||||||
@ -367,3 +393,4 @@ target_link_libraries(test_stt_engines
|
|||||||
AissiaAudio
|
AissiaAudio
|
||||||
spdlog::spdlog
|
spdlog::spdlog
|
||||||
)
|
)
|
||||||
|
# Link Winsock for httplib on Windows (already linked via AissiaLLM PUBLIC dependency)
|
||||||
|
|||||||
1
external/GroveEngine
vendored
1
external/GroveEngine
vendored
@ -1 +0,0 @@
|
|||||||
/mnt/e/Users/Alexis Trouvé/Documents/Projets/GroveEngine
|
|
||||||
@ -7,7 +7,8 @@
|
|||||||
* Requires cpp-httplib and OpenSSL for HTTPS support.
|
* Requires cpp-httplib and OpenSSL for HTTPS support.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CPPHTTPLIB_OPENSSL_SUPPORT
|
// Only enable OpenSSL support if it was found during CMake configuration
|
||||||
|
// CPPHTTPLIB_OPENSSL_SUPPORT is defined via target_compile_definitions when OpenSSL is available
|
||||||
#include <httplib.h>
|
#include <httplib.h>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -72,9 +73,12 @@ public:
|
|||||||
std::string url = (m_useSSL ? "https://" : "http://") + m_host;
|
std::string url = (m_useSSL ? "https://" : "http://") + m_host;
|
||||||
httplib::Client client(url);
|
httplib::Client client(url);
|
||||||
|
|
||||||
|
// Only enable certificate verification if OpenSSL support is compiled in
|
||||||
|
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
|
||||||
if (m_useSSL) {
|
if (m_useSSL) {
|
||||||
client.enable_server_certificate_verification(true);
|
client.enable_server_certificate_verification(true);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
client.set_connection_timeout(m_timeoutSeconds);
|
client.set_connection_timeout(m_timeoutSeconds);
|
||||||
client.set_read_timeout(m_timeoutSeconds);
|
client.set_read_timeout(m_timeoutSeconds);
|
||||||
@ -122,9 +126,12 @@ public:
|
|||||||
std::string url = (m_useSSL ? "https://" : "http://") + m_host;
|
std::string url = (m_useSSL ? "https://" : "http://") + m_host;
|
||||||
httplib::Client client(url);
|
httplib::Client client(url);
|
||||||
|
|
||||||
|
// Only enable certificate verification if OpenSSL support is compiled in
|
||||||
|
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
|
||||||
if (m_useSSL) {
|
if (m_useSSL) {
|
||||||
client.enable_server_certificate_verification(true);
|
client.enable_server_certificate_verification(true);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
client.set_connection_timeout(m_timeoutSeconds);
|
client.set_connection_timeout(m_timeoutSeconds);
|
||||||
client.set_read_timeout(m_timeoutSeconds);
|
client.set_read_timeout(m_timeoutSeconds);
|
||||||
@ -158,9 +165,12 @@ public:
|
|||||||
std::string url = (m_useSSL ? "https://" : "http://") + m_host;
|
std::string url = (m_useSSL ? "https://" : "http://") + m_host;
|
||||||
httplib::Client client(url);
|
httplib::Client client(url);
|
||||||
|
|
||||||
|
// Only enable certificate verification if OpenSSL support is compiled in
|
||||||
|
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
|
||||||
if (m_useSSL) {
|
if (m_useSSL) {
|
||||||
client.enable_server_certificate_verification(true);
|
client.enable_server_certificate_verification(true);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
client.set_connection_timeout(m_timeoutSeconds);
|
client.set_connection_timeout(m_timeoutSeconds);
|
||||||
client.set_read_timeout(m_timeoutSeconds);
|
client.set_read_timeout(m_timeoutSeconds);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user