Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,8 @@ config.json

.envrc
.cache/
.claude/
.claude/
# Former submodule checkouts (dependencies are now fetched by CMake)
/third_party/zlib/
/third_party/googletest/
/third_party/clickhouse-cpp/
9 changes: 0 additions & 9 deletions .gitmodules

This file was deleted.

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ option(BUILD_TESTS "Build tests" OFF)
option(BUILD_EXAMPLES "Build example applications" ON)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)

# Add third party directory with submodules
# Add third party directory (vendored and CMake-fetched dependencies)
add_subdirectory(third_party)

# Find system OpenSSL
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This document provides comprehensive information about developing, building, and
### 1. Clone the Repository

```bash
git clone --recursive https://github.com/ClickHouse/ai-sdk-cpp.git
git clone https://github.com/ClickHouse/ai-sdk-cpp.git
cd ai-sdk-cpp
```

Expand Down
4 changes: 2 additions & 2 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
uv run scripts/build.py --mode debug --tests --clean --export-compile-commands

This script handles:
- CMake configuration with git submodule dependencies
- CMake configuration with vendored and CMake-fetched dependencies
- Building in Debug or Release mode
- Optional test building
- Clean builds
Expand Down Expand Up @@ -133,7 +133,7 @@ def main(mode: str, tests: bool, clean: bool, verbose: bool, export_compile_comm
# Create build directory
build_dir.mkdir(exist_ok=True)

console.print("[green]✓[/green] Dependencies configured via git submodules")
console.print("[green]✓[/green] Dependencies vendored in-tree or fetched by CMake")
console.print()

# Configure CMake
Expand Down
17 changes: 13 additions & 4 deletions third_party/clickhouse-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# ClickHouse C++ Client CMake wrapper
# This wrapper provides a consistent interface for the ClickHouse C++ client library
# Fetches clickhouse-cpp, pinned to the revision this repository previously
# tracked as a git submodule.

# Only build ClickHouse client for tests
if(NOT BUILD_TESTS)
return()
endif()

# Add ClickHouse client as subdirectory
add_subdirectory(../clickhouse-cpp clickhouse-cpp EXCLUDE_FROM_ALL)
include(FetchContent)

FetchContent_Declare(clickhouse-cpp
URL https://github.com/ClickHouse/clickhouse-cpp/archive/cae657a672ff09b715d7127b13eb25d63bea01d4.tar.gz
)
FetchContent_GetProperties(clickhouse-cpp)
if(NOT clickhouse-cpp_POPULATED)
FetchContent_Populate(clickhouse-cpp)
add_subdirectory(${clickhouse-cpp_SOURCE_DIR} ${clickhouse-cpp_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

# Create an interface target that properly exposes ClickHouse client
add_library(clickhouse-cpp-client INTERFACE)
Expand All @@ -32,4 +41,4 @@ else()
endif()

# Create alias for consistent naming
add_library(ClickHouse::Client ALIAS clickhouse-cpp-client)
add_library(ClickHouse::Client ALIAS clickhouse-cpp-client)
1 change: 0 additions & 1 deletion third_party/clickhouse-cpp
Submodule clickhouse-cpp deleted from cae657
1 change: 0 additions & 1 deletion third_party/googletest
Submodule googletest deleted from 3983f6
16 changes: 11 additions & 5 deletions third_party/googletest-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Fetch GoogleTest, pinned to the revision this repository previously tracked
# as a git submodule.
include(FetchContent)

# Configure GoogleTest build options
set(INSTALL_GTEST OFF CACHE INTERNAL "Disable GoogleTest installation")
set(gtest_force_shared_crt ON CACHE INTERNAL "Use shared CRT on Windows")

# Add GoogleTest as subdirectory
add_subdirectory(
${AI_SDK_THIRD_PARTY_DIR}/googletest
${CMAKE_CURRENT_BINARY_DIR}/googletest
EXCLUDE_FROM_ALL
FetchContent_Declare(googletest
URL https://github.com/google/googletest/archive/3983f67e32fb3e9294487b9d4f9586efa6e5d088.tar.gz
)
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
1 change: 0 additions & 1 deletion third_party/zlib
Submodule zlib deleted from 5a82f7
16 changes: 11 additions & 5 deletions third_party/zlib-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Fetch zlib (needed by httplib compression), pinned to the revision this
# repository previously tracked as a git submodule.
include(FetchContent)

# Configure zlib build options
set(ZLIB_BUILD_EXAMPLES OFF CACHE INTERNAL "Disable zlib examples")

# Add zlib as subdirectory
add_subdirectory(
${AI_SDK_THIRD_PARTY_DIR}/zlib
${CMAKE_CURRENT_BINARY_DIR}/zlib
EXCLUDE_FROM_ALL
FetchContent_Declare(zlib
URL https://github.com/madler/zlib/archive/5a82f71ed1dfc0bec044d9702463dbdf84ea3b71.tar.gz
)
FetchContent_GetProperties(zlib)
if(NOT zlib_POPULATED)
FetchContent_Populate(zlib)
add_subdirectory(${zlib_SOURCE_DIR} ${zlib_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

# Create ZLIB::ZLIB alias if it doesn't exist
if(TARGET zlibstatic AND NOT TARGET ZLIB::ZLIB)
Expand Down
Loading