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
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ jobs:
find logs -type f -maxdepth 3 -print || true

- name: Upload logs (configure + build)
if: always()
if: always() && runner.os != 'Windows'
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.vixos }}-${{ matrix.arch }}
Expand Down Expand Up @@ -300,7 +300,7 @@ jobs:
if (Test-Path "build_output.log") { Copy-Item "build_output.log" $out -Force }

- name: Upload logs (configure + build)
if: always()
if: always() && runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.vixos }}-${{ matrix.arch }}
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@
path = modules/db
url = git@github.com:vixcpp/db.git
branch = dev
[submodule "third_party/asio-src"]
path = third_party/asio-src
url = https://github.com/chriskohlhoff/asio.git
63 changes: 23 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ option(VIX_DB_USE_POSTGRES "Enable PostgreSQL backend in vix_db" OFF)
option(VIX_DB_USE_REDIS "Enable Redis backend in vix_db" OFF)
option(VIX_ENABLE_P2P "Build Vix P2P module" ON)
option(VIX_ENABLE_CACHE "Build Vix Cache module" ON)
option(VIX_FETCH_DEPS "Allow fetching missing deps from the internet" OFF)

# ----------------------------------------------------
# Tooling / Static analysis
Expand Down Expand Up @@ -243,35 +244,23 @@ add_library(vix INTERFACE)
# ----------------------------------------------------
# Third-party: Asio (standalone, header-only)
# Exposes: vix::thirdparty_asio
# Used by: vix::p2p
# ----------------------------------------------------
add_library(vix_thirdparty_asio INTERFACE)
add_library(vix::thirdparty_asio ALIAS vix_thirdparty_asio)
target_compile_definitions(vix_thirdparty_asio INTERFACE ASIO_STANDALONE=1)

set(VIX_THIRDPARTY_ASIO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/asio/include")
set(VIX_THIRDPARTY_ASIO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/asio-src/asio/include")

if (EXISTS "${VIX_THIRDPARTY_ASIO_DIR}/asio.hpp")
message(STATUS "Asio: using vendored Asio at ${VIX_THIRDPARTY_ASIO_DIR}")
target_include_directories(vix_thirdparty_asio SYSTEM INTERFACE
$<BUILD_INTERFACE:${VIX_THIRDPARTY_ASIO_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/vix/third_party/asio>
)

else()
message(WARNING "Asio vendored copy missing -> fetching via FetchContent")
include(FetchContent)
FetchContent_Declare(asio
GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git
GIT_TAG asio-1-30-2
$<BUILD_INTERFACE:${VIX_THIRDPARTY_ASIO_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/vix/third_party/asio>
)
FetchContent_MakeAvailable(asio)

target_include_directories(vix_thirdparty_asio SYSTEM INTERFACE
$<BUILD_INTERFACE:${asio_SOURCE_DIR}/asio/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/vix/third_party/asio>
)
else()
message(FATAL_ERROR "Asio submodule missing: third_party/asio-src. Run: git submodule update --init --recursive")
endif()
target_link_libraries(vix INTERFACE vix::thirdparty_asio)

add_library(vix::vix ALIAS vix)

Expand Down Expand Up @@ -895,34 +884,28 @@ if (VIX_ENABLE_INSTALL)
FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h")
endif()

# ---- Install Asio headers exactly from the selected source ----
set(_VIX_ASIO_INSTALL_SRC "")

if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/asio/include/asio.hpp")
# vendored copy
set(_VIX_ASIO_INSTALL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/third_party/asio/include")
elseif (DEFINED asio_SOURCE_DIR AND EXISTS "${asio_SOURCE_DIR}/asio/include/asio.hpp")
# FetchContent
set(_VIX_ASIO_INSTALL_SRC "${asio_SOURCE_DIR}/asio/include")
endif()
# ---- Install Asio (submodule) — robust (no symlink issues) ----
set(_VIX_ASIO_INSTALL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/third_party/asio-src/asio/include")

if (_VIX_ASIO_INSTALL_SRC STREQUAL "")
message(FATAL_ERROR "Asio is required but no installable Asio headers were found.")
endif()
if (NOT EXISTS "${_VIX_ASIO_INSTALL_SRC}/asio.hpp")
message(FATAL_ERROR "Asio submodule missing: third_party/asio-src. Run: git submodule update --init --recursive")
endif()

install(DIRECTORY "${_VIX_ASIO_INSTALL_SRC}/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vix/third_party/asio
FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h"
)
file(GLOB_RECURSE _VIX_ASIO_HEADERS
CONFIGURE_DEPENDS
"${_VIX_ASIO_INSTALL_SRC}/*.hpp"
"${_VIX_ASIO_INSTALL_SRC}/*.h"
)

install(FILES ${_VIX_ASIO_HEADERS}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/vix/third_party/asio"
)

# Export umbrella target (modules must also export their targets into VixTargets)
install(TARGETS vix EXPORT VixTargets)

# Export third-party interface targets needed by exported modules (e.g. vix_p2p)
if (TARGET vix_thirdparty_asio)
install(TARGETS vix_thirdparty_asio EXPORT VixTargets)
endif()
if (TARGET vix_thirdparty_asio)
install(TARGETS vix_thirdparty_asio EXPORT VixTargets)
endif()

if (TARGET vix_warnings)
install(TARGETS vix_warnings EXPORT VixTargets)
Expand Down
2 changes: 1 addition & 1 deletion modules/cli
Submodule cli updated 1 files
+105 −34 src/cmake/CMakeBuild.cpp
2 changes: 1 addition & 1 deletion modules/core
Submodule core updated 1 files
+0 −10 tests/core_smoke_test.cpp
2 changes: 1 addition & 1 deletion modules/p2p
1 change: 1 addition & 0 deletions third_party/asio-src
Submodule asio-src added at 55684d
Loading