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
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,21 @@ jobs:
NETFT_CXX_COMPILER: ${{ matrix.compiler.cxx }}
run: pixi run bash test/install_test.sh ${{ matrix.library }}

cmake-316:
name: CMake 3.16 compatibility
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@v0.8.1
with:
cache: true
- name: Verify pinned CMake version
run: pixi run -e cmake-316 cmake --version | grep -E '^cmake version 3\.16\.'
- name: Test shared and static consumers
run: pixi run -e cmake-316 cmake-316-test

sanitizers:
name: ASan and UBSan
runs-on: ubuntu-24.04
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ compile_commands.json
# Pixi and local environments
/.pixi/
/.cache/
/.worktrees/

# Test artifacts
Testing/
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project are documented in this file.

## 0.1.2 - 2026-07-22

### Changed

- Lower the supported CMake baseline from 3.20 to 3.16 and verify shared and static installed consumers with the pinned minimum version in CI.

## 0.1.1 - 2026-07-22

### Fixed
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.16)

project(netft VERSION 0.1.1 LANGUAGES CXX)
project(netft VERSION 0.1.2 LANGUAGES CXX)

include(CTest)
include(GNUInstallDirs)
Expand Down Expand Up @@ -113,5 +113,12 @@ install(

if(BUILD_TESTING)
find_package(GTest REQUIRED)
if(TARGET GTest::gtest_main)
set(NETFT_GTEST_MAIN_TARGET GTest::gtest_main)
elseif(TARGET GTest::Main)
set(NETFT_GTEST_MAIN_TARGET GTest::Main)
else()
message(FATAL_ERROR "GoogleTest does not provide a main target")
endif()
add_subdirectory(test)
endif()
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ configuration discovery, stream health reporting, and explicit recovery policies
## Supported platforms

The supported platforms are 64-bit Linux on x86-64 and AArch64. Building requires a C++17
compiler, CMake 3.20 or newer, POSIX threads, and libcurl 7.62 or newer. GoogleTest is required
compiler, CMake 3.16 or newer, POSIX threads, and libcurl 7.62 or newer. GoogleTest is required
only when `BUILD_TESTING=ON`. The checked-in Pixi environment supports both `linux-64` and
`linux-aarch64` and provides the development toolchain.

Expand Down
1,274 changes: 1,261 additions & 13 deletions pixi.lock

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
name = "netft-cpp"
version = "0.1.1"
version = "0.1.2"
channels = ["conda-forge"]
platforms = ["linux-64", "linux-aarch64"]

Expand Down Expand Up @@ -30,3 +30,12 @@ format = "git ls-files -z '*.cpp' '*.hpp' | xargs -0 clang-format -i"
format-check = "git ls-files -z '*.cpp' '*.hpp' | xargs -0 clang-format --dry-run --Werror"
tidy = { cmd = "cmake -S . -B build/tidy -G Ninja -DBUILD_TESTING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && clang-tidy -p build/tidy --config-file=.clang-tidy $(git ls-files 'src/*.cpp' 'app/*.cpp')", depends-on = [] }
coverage = "cmake -S . -B build/coverage -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DCMAKE_CXX_FLAGS='--coverage -O0 -g' -DCMAKE_EXE_LINKER_FLAGS=--coverage -DCMAKE_SHARED_LINKER_FLAGS=--coverage && cmake --build build/coverage && ctest --test-dir build/coverage --output-on-failure && gcovr --root . --filter 'src/' --filter 'app/' --exclude 'test/' --exclude-unreachable-branches --exclude-throw-branches --xml-pretty --output coverage.xml --fail-under-line 85 build/coverage"

[feature.cmake-316.dependencies]
cmake = "3.16.*"

[feature.cmake-316.tasks]
cmake-316-test = "bash test/cmake_compatibility_test.sh"

[environments]
cmake-316 = { features = ["cmake-316"] }
20 changes: 10 additions & 10 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_executable(netft_types test_types.cpp)
target_link_libraries(netft_types PRIVATE netft::netft GTest::gtest_main)
target_link_libraries(netft_types PRIVATE netft::netft ${NETFT_GTEST_MAIN_TARGET})

add_test(NAME netft_types COMMAND netft_types)

Expand All @@ -8,12 +8,12 @@ add_executable(netft_protocol
${CMAKE_CURRENT_SOURCE_DIR}/../src/detail/protocol.cpp
)
target_include_directories(netft_protocol PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src)
target_link_libraries(netft_protocol PRIVATE netft::netft GTest::gtest_main)
target_link_libraries(netft_protocol PRIVATE netft::netft ${NETFT_GTEST_MAIN_TARGET})

add_test(NAME netft_protocol COMMAND netft_protocol)

add_executable(netft_status test_status.cpp)
target_link_libraries(netft_status PRIVATE netft::netft GTest::gtest_main)
target_link_libraries(netft_status PRIVATE netft::netft ${NETFT_GTEST_MAIN_TARGET})

add_test(NAME netft_status COMMAND netft_status)

Expand All @@ -22,7 +22,7 @@ add_executable(netft_sequence
${CMAKE_CURRENT_SOURCE_DIR}/../src/detail/sequence.cpp
)
target_include_directories(netft_sequence PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src)
target_link_libraries(netft_sequence PRIVATE netft::netft GTest::gtest_main)
target_link_libraries(netft_sequence PRIVATE netft::netft ${NETFT_GTEST_MAIN_TARGET})

add_test(NAME netft_sequence COMMAND netft_sequence)

Expand All @@ -33,7 +33,7 @@ add_executable(netft_fault_latch
target_include_directories(netft_fault_latch PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../src
)
target_link_libraries(netft_fault_latch PRIVATE netft::netft GTest::gtest_main)
target_link_libraries(netft_fault_latch PRIVATE netft::netft ${NETFT_GTEST_MAIN_TARGET})

add_test(NAME netft_fault_latch COMMAND netft_fault_latch)

Expand All @@ -46,7 +46,7 @@ target_include_directories(netft_discovery PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../src
)
target_link_libraries(netft_discovery PRIVATE netft::netft GTest::gtest_main)
target_link_libraries(netft_discovery PRIVATE netft::netft ${NETFT_GTEST_MAIN_TARGET})

add_test(NAME netft_discovery COMMAND netft_discovery)

Expand All @@ -59,7 +59,7 @@ target_include_directories(netft_client_stream PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../src
)
target_link_libraries(netft_client_stream PRIVATE netft::netft GTest::gtest_main)
target_link_libraries(netft_client_stream PRIVATE netft::netft ${NETFT_GTEST_MAIN_TARGET})

add_test(NAME netft_client_stream COMMAND netft_client_stream)

Expand All @@ -72,7 +72,7 @@ target_include_directories(netft_client_recovery PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../src
)
target_link_libraries(netft_client_recovery PRIVATE netft::netft GTest::gtest_main)
target_link_libraries(netft_client_recovery PRIVATE netft::netft ${NETFT_GTEST_MAIN_TARGET})

add_test(NAME netft_client_recovery COMMAND netft_client_recovery)

Expand Down Expand Up @@ -100,7 +100,7 @@ target_include_directories(netft_client_lifecycle PRIVATE
)
target_link_libraries(netft_client_lifecycle PRIVATE
netft_client_impl_test
GTest::gtest_main
${NETFT_GTEST_MAIN_TARGET}
)

add_test(NAME netft_client_lifecycle COMMAND netft_client_lifecycle)
Expand All @@ -120,7 +120,7 @@ target_compile_definitions(netft_cli_test PRIVATE
)
target_link_libraries(netft_cli_test PRIVATE
netft_cli_lib
GTest::gtest_main
${NETFT_GTEST_MAIN_TARGET}
)
add_dependencies(netft_cli_test netft_cli)

Expand Down
16 changes: 16 additions & 0 deletions test/cmake_compatibility_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
cmake_version="$(cmake --version | sed -n '1s/^cmake version //p')"

case "$cmake_version" in
3.16.*) ;;
*)
echo "expected CMake 3.16.x, got ${cmake_version:-unknown}" >&2
exit 1
;;
esac

bash "$repo_root/test/install_test.sh" shared
bash "$repo_root/test/install_test.sh" static
Loading