- Add MinGW compatibility shim for cpp-httplib GetAddrInfoExCancel - Fix portaudio linking (portaudio_static -> portaudio) - Disable -Werror for MinGW builds due to httplib incompatibilities - Add console subsystem flag for MinGW builds - Add debug logging utilities (Logger.h) - Add MessageBox debugging for Windows troubleshooting - Update build scripts with better error handling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
76 lines
1.9 KiB
CMake
76 lines
1.9 KiB
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(SecondVoice VERSION 0.1.0 LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
# Find packages
|
|
find_package(portaudio CONFIG REQUIRED)
|
|
find_package(httplib CONFIG REQUIRED)
|
|
find_package(nlohmann_json CONFIG REQUIRED)
|
|
find_package(imgui CONFIG REQUIRED)
|
|
find_package(glfw3 CONFIG REQUIRED)
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
# Source files
|
|
set(SOURCES
|
|
src/main.cpp
|
|
# Audio module
|
|
src/audio/AudioCapture.cpp
|
|
src/audio/AudioBuffer.cpp
|
|
# API clients
|
|
src/api/WhisperClient.cpp
|
|
src/api/ClaudeClient.cpp
|
|
# UI
|
|
src/ui/TranslationUI.cpp
|
|
# Utils
|
|
src/utils/Config.cpp
|
|
# Core
|
|
src/core/Pipeline.cpp
|
|
)
|
|
|
|
# Executable
|
|
add_executable(${PROJECT_NAME} ${SOURCES})
|
|
|
|
# Include directories
|
|
target_include_directories(${PROJECT_NAME} PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
)
|
|
|
|
# Link libraries
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
|
portaudio
|
|
httplib::httplib
|
|
nlohmann_json::nlohmann_json
|
|
imgui::imgui
|
|
glfw
|
|
OpenGL::GL
|
|
)
|
|
|
|
# Compiler options
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
|
-Wall
|
|
-Wextra
|
|
-Wpedantic
|
|
)
|
|
|
|
# MinGW: cpp-httplib's GetAddrInfoExCancel is not available
|
|
# Don't treat warnings as errors for MinGW due to httplib incompatibilities
|
|
if(NOT MINGW)
|
|
target_compile_options(${PROJECT_NAME} PRIVATE -Werror)
|
|
else()
|
|
# Force console subsystem on Windows (not GUI subsystem)
|
|
target_link_options(${PROJECT_NAME} PRIVATE -mconsole)
|
|
endif()
|
|
endif()
|
|
|
|
# Copy config files to build directory
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.json
|
|
${CMAKE_CURRENT_BINARY_DIR}/config.json COPYONLY)
|
|
|
|
# Install target
|
|
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
|
|
install(FILES config.json DESTINATION bin)
|