Skip to content

Commit eee7d19

Browse files
committed
drop the ublk execution backend option in favor of a header guard
1 parent 7f28701 commit eee7d19

7 files changed

Lines changed: 12 additions & 20 deletions

File tree

‎.github/workflows/ci-latest-kernel.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jobs:
9999
-DUBLKCPP_BUILD_TESTS=ON \
100100
-DUBLKCPP_BUILD_UBLKCTL=ON \
101101
-DUBLKCPP_TESTS_STATIC_LINK=ON \
102+
-DCONDY_LINK_STDEXEC=ON \
102103
-DCMAKE_C_COMPILER=clang \
103104
-DCMAKE_CXX_COMPILER=clang++ \
104105
-DCMAKE_BUILD_TYPE=Release

‎.github/workflows/ci-main.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
-DUBLKCPP_BUILD_TESTS=ON \
5555
-DUBLKCPP_BUILD_UBLKCTL=ON \
5656
-DUBLKCPP_BUILD_EXAMPLES=ON \
57-
-DUBLKCPP_EXECUTION_BACKEND=stdexec \
57+
-DCONDY_LINK_STDEXEC=ON \
5858
$SANITIZER_FLAG \
5959
-DCMAKE_C_COMPILER=${{matrix.compiler.cc}} \
6060
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} \

‎.github/workflows/ci-static-check.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
cmake -B ${{github.workspace}}/build \
4040
-DUBLKCPP_BUILD_TESTS=ON \
4141
-DUBLKCPP_BUILD_UBLKCTL=ON \
42+
-DCONDY_LINK_STDEXEC=ON \
4243
-DCMAKE_C_COMPILER=clang \
4344
-DCMAKE_CXX_COMPILER=clang++ \
4445
-DCMAKE_BUILD_TYPE=Debug \

‎.github/workflows/ci-toolchain.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
backend: [ "stdexec", "beman" ]
23+
backend: [ STDEXEC, BEMAN ]
2424
compiler:
2525
- { cc: gcc, cxx: g++ }
2626
- { cc: clang, cxx: clang++ }
@@ -49,7 +49,7 @@ jobs:
4949
-DUBLKCPP_BUILD_TESTS=ON \
5050
-DUBLKCPP_BUILD_UBLKCTL=ON \
5151
-DUBLKCPP_BUILD_EXAMPLES=ON \
52-
-DUBLKCPP_EXECUTION_BACKEND=${{ matrix.backend }} \
52+
-DCONDY_LINK_${{ matrix.backend }}=ON \
5353
-DCMAKE_C_COMPILER=${{matrix.compiler.cc}} \
5454
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} \
5555
-DCMAKE_BUILD_TYPE=Debug

‎CMakeLists.txt‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ option(UBLKCPP_USE_URING_CMD128 "Use IORING_OP_URING_CMD128 for control commands
2020
option(UBLKCPP_TESTS_STATIC_LINK "Use static linking for tests" OFF)
2121
option(UBLKCPP_TESTS_ASAN "Enable address and undefined behavior sanitizers for tests" OFF)
2222
option(UBLKCPP_TESTS_TSAN "Enable thread sanitizer for tests" OFF)
23-
set(UBLKCPP_EXECUTION_BACKEND "stdexec" CACHE STRING
24-
"std::execution implementation used via Condy: stdexec (default) or beman")
2523

2624
include(FetchContent)
2725

@@ -52,18 +50,6 @@ if(UBLKCPP_USE_URING_CMD128)
5250
target_compile_definitions(ublkcpp INTERFACE UBLKCPP_USE_URING_CMD128)
5351
endif()
5452

55-
if(UBLKCPP_EXECUTION_BACKEND STREQUAL "beman")
56-
set(CONDY_LINK_STDEXEC OFF)
57-
set(CONDY_LINK_BEMAN ON)
58-
elseif(UBLKCPP_EXECUTION_BACKEND STREQUAL "stdexec")
59-
set(CONDY_LINK_STDEXEC ON)
60-
set(CONDY_LINK_BEMAN OFF)
61-
else()
62-
message(FATAL_ERROR
63-
"UBLKCPP_EXECUTION_BACKEND must be 'stdexec' or 'beman', got '"
64-
"${UBLKCPP_EXECUTION_BACKEND}'")
65-
endif()
66-
message(STATUS "ublkcpp: execution backend: ${UBLKCPP_EXECUTION_BACKEND}")
6753
add_subdirectory(third_party/condy)
6854
target_link_libraries(ublkcpp INTERFACE condy)
6955

‎docs/build.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@brief How to build and integrate ublk-cpp in your project.
44

55
> [!NOTE]
6-
> ublk-cpp currently depends on condy's **experimental execution integration**, which can be backed by either **stdexec** (default) or **beman/execution**. Once `std::execution` is finalized in C++26, it will migrate to the standard library implementation.
6+
> ublk-cpp requires condy with `std::execution` support. Condy uses the standard library implementation when available, or a fetched backend ([stdexec](https://github.com/NVIDIA/stdexec) or [beman/execution](https://github.com/bemanproject/execution)) enabled through condy's `CONDY_LINK_STDEXEC` / `CONDY_LINK_BEMAN` options.
77
88
## Using ublk-cpp as a Submodule
99

@@ -42,7 +42,7 @@ target_link_libraries(my_app PRIVATE ublkcpp)
4242

4343
Condy fetches and **statically links liburing** by default (`CONDY_LINK_LIBURING=ON`). To use the liburing installed on your system instead, configure with `CONDY_LINK_LIBURING=OFF`.
4444

45-
ublk-cpp currently also fetches and depends on **[stdexec](https://github.com/NVIDIA/stdexec)**, or **[beman/execution](https://github.com/bemanproject/execution)** when enabled via the `UBLKCPP_EXECUTION_BACKEND` option. Once `std::execution` is finalized in C++26, this dependency is expected to be replaced by the standard library implementation.
45+
ublk-cpp requires condy with `std::execution` support. When the standard library provides it, condy detects it automatically. Otherwise enable a fetched backend with `CONDY_LINK_STDEXEC=ON` ([stdexec](https://github.com/NVIDIA/stdexec)) or `CONDY_LINK_BEMAN=ON` ([beman/execution](https://github.com/bemanproject/execution)).
4646

4747
## Building
4848

@@ -57,13 +57,13 @@ ublk-cpp provides CMake options to build tests, the `ublkctl` tool, examples, an
5757
| `UBLKCPP_USE_URING_CMD128` | Use `IORING_OP_URING_CMD128` for control commands | ON |
5858
| `UBLKCPP_TESTS_STATIC_LINK` | Use static linking for tests | OFF |
5959
| `UBLKCPP_TESTS_ASAN` | Enable ASan/UBSan for tests | OFF |
60-
| `UBLKCPP_EXECUTION_BACKEND` | `std::execution` implementation used via Condy: `stdexec` or `beman` | `stdexec` |
6160

6261
```bash
6362
cmake -B build -S . \
6463
-DUBLKCPP_BUILD_TESTS=ON \
6564
-DUBLKCPP_BUILD_UBLKCTL=ON \
6665
-DUBLKCPP_BUILD_EXAMPLES=ON \
66+
-DCONDY_LINK_STDEXEC=ON \
6767
-DCMAKE_BUILD_TYPE=Release
6868
cmake --build build -j$(nproc)
6969
```

‎include/ublk/detail/execution.hpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
#include <condy.hpp>
99

10+
#ifndef CONDY_DETAIL_HAS_EXECUTION
11+
#error "ublk-cpp requires a condy backend for std::execution"
12+
#endif
13+
1014
namespace ublk {
1115
namespace detail {
1216

0 commit comments

Comments
 (0)