diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ddc922f..3aee651 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} @@ -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 }} diff --git a/.gitmodules b/.gitmodules index 76375dc..97afb71 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index e91a34f..cc252cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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 - $ - $ -) - -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 + $ + $ ) - FetchContent_MakeAvailable(asio) - - target_include_directories(vix_thirdparty_asio SYSTEM INTERFACE - $ - $ -) +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) @@ -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) diff --git a/modules/cli b/modules/cli index 16aa52e..8e71501 160000 --- a/modules/cli +++ b/modules/cli @@ -1 +1 @@ -Subproject commit 16aa52e47038ae2123c4abf62615b2a110b9f335 +Subproject commit 8e71501f3c8c4d9e99ef45bd02adbd7f9705f643 diff --git a/modules/core b/modules/core index 01b3802..8957c84 160000 --- a/modules/core +++ b/modules/core @@ -1 +1 @@ -Subproject commit 01b3802bbfc746a8db1e118de3f8b33123e25483 +Subproject commit 8957c845fbea249fdb71d3d32ed59ad2f503cb4b diff --git a/modules/p2p b/modules/p2p index 108dfd7..2fa8e4b 160000 --- a/modules/p2p +++ b/modules/p2p @@ -1 +1 @@ -Subproject commit 108dfd7e5cc9f371d7cdb3a97933c0a1f2e69060 +Subproject commit 2fa8e4b7d60589a3532b23a383b07a9fabc6ab53 diff --git a/third_party/asio-src b/third_party/asio-src new file mode 160000 index 0000000..55684d4 --- /dev/null +++ b/third_party/asio-src @@ -0,0 +1 @@ +Subproject commit 55684d42ac00021b4c31ba8571aca414c863ead5