Skip to content
Draft
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
25 changes: 2 additions & 23 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,7 @@ name: Linux Build

on:
push:
branches: ["main"]
paths:
- "include/**"
- "src/**"
- "tests/**"
- "examples/**"
- "cmake/**"
- "Makefile"
- "CMakePresets.json"
- "CMakeLists.txt"
- ".github/workflows/linux.yml"
pull_request:
branches: ["main"]
paths:
- "include/**"
- "src/**"
- "tests/**"
- "examples/**"
- "cmake/**"
- "Makefile"
- "CMakePresets.json"
- "CMakeLists.txt"
- ".github/workflows/linux.yml"

jobs:
build:
Expand All @@ -38,7 +16,8 @@ jobs:
matrix:
# TODO: sanitizer: [debug, release, asan, usan, tsan, lsan, msan]
preset: [debug, release]
compiler: [g++-14, clang++-19]
# TODO: compiler: [g++-15, clang++-19]
compiler: [clang++-19]

steps:
- uses: actions/checkout@v4
Expand Down
37 changes: 6 additions & 31 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,7 @@ name: Macos Build

on:
push:
branches: ["main"]
paths:
- "include/**"
- "src/**"
- "tests/**"
- "examples/**"
- "cmake/**"
- "Makefile"
- "CMakePresets.json"
- "CMakeLists.txt"
- ".github/workflows/macos.yml"
pull_request:
branches: ["main"]
paths:
- "include/**"
- "src/**"
- "tests/**"
- "examples/**"
- "cmake/**"
- "Makefile"
- "CMakePresets.json"
- "CMakeLists.txt"
- ".github/workflows/macos.yml"

jobs:
build:
Expand All @@ -37,8 +15,8 @@ jobs:

matrix:
preset: [debug, release]
# TODO: compiler: [g++, clang++-19]
compiler: [g++, clang++-18]
# TODO: compiler: [g++-15, clang++-19]
compiler: [clang++-19]

steps:
- uses: actions/checkout@v4
Expand All @@ -47,23 +25,20 @@ jobs:
# if: startsWith(matrix.compiler, 'clang')
uses: aminya/setup-cpp@v1
with:
# TODO: compiler: llvm-19
# clangtidy: true
# cmake: true
ninja: true

- name: Install llvm-19
if: startsWith(matrix.compiler, 'clang')
run: |
brew install llvm@19 || echo ignored

- name: macos clang++-18 ${{ matrix.preset }}
- name: macos clang++-19 ${{ matrix.preset }}
if: startsWith(matrix.compiler, 'clang')
run: CXX=$(brew --prefix llvm@18)/bin/clang++ cmake --workflow --preset ${{ matrix.preset }}
run: CXX=$(brew --prefix llvm@19)/bin/clang++ cmake --workflow --preset ${{ matrix.preset }}

- name: macos clang++-18 sanitizer
- name: macos clang++-19 sanitizer
if: startsWith(matrix.compiler, 'clang') && startsWith(matrix.preset, 'debug')
run: CXX=$(brew --prefix llvm@18)/bin/clang++ make all
run: CXX=$(brew --prefix llvm@19)/bin/clang++ make all

- name: macos g++ ${{ matrix.preset }}
if: startsWith(matrix.compiler, 'g++')
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,7 @@ name: Windows Build

on:
push:
branches: ["main"]
paths:
- "include/**"
- "src/**"
- "tests/**"
- "examples/**"
- "cmake/**"
- "CMakePresets.json"
- "CMakeLists.txt"
- ".github/workflows/windows.yml"
pull_request:
branches: ["main"]
paths:
- "include/**"
- "src/**"
- "tests/**"
- "examples/**"
- "cmake/**"
- "CMakePresets.json"
- "CMakeLists.txt"
- ".github/workflows/windows.yml"

jobs:
build:
Expand Down
15 changes: 11 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# cmake-format: on

cmake_minimum_required(VERSION 3.25...3.31)
cmake_minimum_required(VERSION 3.30...3.31)

project(beman_execution26 VERSION 0.0.1 LANGUAGES CXX)
project(beman_execution26 VERSION 0.1.0 LANGUAGES CXX)

if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds are not allowed!")
endif()

# Note that scanning is only performed if C++20 or higher is enabled for the target. Scanning for modules in the target's
# sources belonging to file sets of type CXX_MODULES is always performed.
# not needed: set(CMAKE_CXX_SCAN_FOR_MODULES ON)

set(TARGET_NAME execution26)
set(TARGET_NAMESPACE beman) # FIXME: not used in install(EXPORT ...) CK?
set(TARGET_PREFIX ${TARGET_NAMESPACE}.${TARGET_NAME})
Expand All @@ -19,6 +23,9 @@ set(TARGET_ALIAS ${TARGET_LIBRARY}::${TARGET_LIBRARY})
set(TARGET_PACKAGE_NAME ${PROJECT_NAME}-config)
set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-targets)

# This variable is a special case of the more-general CMAKE_<CONFIG>_POSTFIX variable for the DEBUG configuration.
set(CMAKE_DEBUG_POSTFIX D)

include(GNUInstallDirs)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

Expand Down Expand Up @@ -55,7 +62,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug)
ENABLE_SANITIZER_POINTER_COMPARE
ENABLE_SANITIZER_POINTER_SUBTRACT
ENABLE_CONTROL_FLOW_PROTECTION
ENABLE_STACK_PROTECTION
# XXX ENABLE_STACK_PROTECTION
ENABLE_OVERFLOW_PROTECTION
# ENABLE_ELF_PROTECTION
# ENABLE_RUNTIME_SYMBOLS_RESOLUTION
Expand Down Expand Up @@ -85,7 +92,7 @@ include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-version.cmake
VERSION ${CMAKE_PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
COMPATIBILITY SameMajorVersion
)

configure_package_config_file(
Expand Down
2 changes: 1 addition & 1 deletion cmake/CMakeGenericPresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "path",
"value": "${sourceDir}/stagedir"
},
"CMAKE_CXX_EXTENSIONS": false,
"CMAKE_CXX_EXTENSIONS": true,
"CMAKE_CXX_STANDARD": "23",
"CMAKE_CXX_STANDARD_REQUIRED": true,
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
Expand Down
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
list(
APPEND
EXAMPLES
modules
playground
sender-demo
when_all-cancel
Expand Down
20 changes: 20 additions & 0 deletions examples/modules.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// examples/modules.cpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// import std;
#include <iostream>
#include <string>
#if __cpp_modules < 201907L
#include <beman/execution26/execution.hpp>
#else
import beman_execution26;
#endif

namespace ex = beman::execution26;

int main() {
auto [result] = ex::sync_wait(ex::when_all(ex::just(std::string("hello, ")), ex::just(std::string("world"))) |
ex::then([](const auto& s1, const auto& s2) { return s1 + s2; }))
.value_or(std::tuple(std::string("oops")));
std::cout << "result='" << result << "'\n";
}
2 changes: 2 additions & 0 deletions include/beman/execution26/execution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <beman/execution26/detail/operation_state.hpp>
#include <beman/execution26/detail/sender.hpp>
#include <beman/execution26/detail/sender_in.hpp>
//-dk:TODO #include <beman/execution26/detail/sender_to.hpp>
#include <beman/execution26/detail/scheduler.hpp>
#include <beman/execution26/detail/receiver.hpp>
#include <beman/execution26/detail/valid_completion_for.hpp>
Expand All @@ -37,6 +38,7 @@
#include <beman/execution26/detail/start.hpp>
#include <beman/execution26/detail/connect.hpp>
#include <beman/execution26/detail/schedule.hpp>
#include <beman/execution26/detail/schedule_result_t.hpp>

#include <beman/execution26/detail/continues_on.hpp>
#include <beman/execution26/detail/into_variant.hpp>
Expand Down
23 changes: 16 additions & 7 deletions src/beman/execution26/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ add_library(${TARGET_LIBRARY} STATIC)
add_library(${TARGET_ALIAS} ALIAS ${TARGET_LIBRARY})

if(CMAKE_BUILD_TYPE STREQUAL Debug)
target_link_libraries(${TARGET_LIBRARY} PUBLIC $<BUILD_INTERFACE:${TARGET_LIBRARY}_project_options>)
# NOTE: Sanitizer or gcov is not possible for CXX_MODULES! CK
# XXX target_link_libraries(${TARGET_LIBRARY} PUBLIC $<BUILD_INTERFACE:${TARGET_LIBRARY}_project_options>)
target_link_libraries(${TARGET_LIBRARY} PUBLIC $<BUILD_INTERFACE:${TARGET_LIBRARY}_project_warnings>)
endif()

Expand All @@ -16,7 +17,6 @@ cmake_print_variables(TARGET_ALIAS TARGET_LIBRARY TARGET_PREFIX PROJECT_SOURCE_D

target_sources(
${TARGET_LIBRARY}
PRIVATE execution.cpp
PUBLIC FILE_SET
${TARGET_LIBRARY}_public_headers
TYPE
Expand Down Expand Up @@ -188,18 +188,27 @@ target_compile_features(${TARGET_LIBRARY} PUBLIC
"$<$<NOT:$<COMPILE_FEATURES:cxx_std_26>>:cxx_std_23>"
)

target_sources(
${TARGET_LIBRARY}
PUBLIC FILE_SET ${TARGET_LIBRARY}_modules
TYPE CXX_MODULES FILES execution.cppm
)

install(
TARGETS ${TARGET_LIBRARY}
EXPORT ${TARGETS_EXPORT_NAME}1
ARCHIVE DESTINATION lib/$<CONFIG>
EXPORT ${TARGETS_EXPORT_NAME}
ARCHIVE # XXX DESTINATION lib/$<CONFIG>
FILE_SET ${TARGET_LIBRARY}_modules
# There's currently no convention for this location
DESTINATION ${INSTALL_CONFIGDIR}/src
FILE_SET ${TARGET_LIBRARY}_public_headers
FILE_SET ${TARGET_LIBRARY}_detail_headers
)
# cmake-format: on

install(
EXPORT ${TARGETS_EXPORT_NAME}1
FILE ${TARGETS_EXPORT_NAME}.cmake
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION "${INSTALL_CONFIGDIR}"
CXX_MODULES_DIRECTORY .
NAMESPACE ${TARGET_LIBRARY}::
)
# cmake-format: on
7 changes: 0 additions & 7 deletions src/beman/execution26/execution.cpp

This file was deleted.

Loading
Loading