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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:

# CMake linting and formatting
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.20.0
rev: 0.20.1
hooks:
- id: gersemi
name: CMake linting
Expand Down
10 changes: 10 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@
],
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "infra/cmake/msvc-toolchain.cmake"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
Expand All @@ -113,6 +118,11 @@
],
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "infra/cmake/msvc-toolchain.cmake"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
}
],
Expand Down
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ BUILDROOT = build
SYSTEM = $(shell uname -s)
BUILD = $(BUILDROOT)/$(SYSTEM)/$(SANITIZER)
EXAMPLE = beman.execution.examples.stop_token
CMAKE_CXX_COMPILER=$(COMPILER)

export CXX=$(COMPILER)

ifeq ($(SANITIZER),release)
CXX_FLAGS = -O3 -Wpedantic -Wall -Wextra -Wno-shadow -Werror
Expand Down Expand Up @@ -79,9 +80,10 @@ doc:
# $(MAKE) SANITIZER=$@

build:
CC=$(CXX) cmake --fresh -G Ninja -S $(SOURCEDIR) -B $(BUILD) $(TOOLCHAIN) $(SYSROOT) \
cmake --fresh -G Ninja -S $(SOURCEDIR) -B $(BUILD) $(TOOLCHAIN) $(SYSROOT) \
-D CMAKE_EXPORT_COMPILE_COMMANDS=1 \
-D CMAKE_SKIP_INSTALL_RULES=1 \
-D CMAKE_CXX_STANDARD=23 \
-D CMAKE_CXX_COMPILER=$(CXX) # XXX -D CMAKE_CXX_FLAGS="$(CXX_FLAGS) $(SAN_FLAGS)"
cmake --build $(BUILD)

Expand All @@ -92,11 +94,16 @@ test: build
install: test
cmake --install $(BUILD) --prefix /opt/local

release:
cmake --workflow --preset $@ --fresh
CMakeUserPresets.json: cmake/CMakeUserPresets.json
ln -s $< $@

release: CMakeUserPresets.json
cmake --preset $@ --fresh --log-level=TRACE
cmake --workflow --preset $@

debug:
cmake --workflow --preset $@ --fresh
debug: CMakeUserPresets.json
cmake --preset $@ --fresh --log-level=TRACE
cmake --workflow --preset $@

ce:
@mkdir -p $(BUILD)
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,36 @@ contains some links for general information about the sender/receivers and `std:

## Build

## Precondisions

- cmake v3.30 or newer
- ninja v1.11.1 or newer
- A compiler that supports at least C++23


| Library | Linux | MacOS | Windows |
| ------- | ----- | ----- | ------- |
| build | ![Linux build status](https://github.com/bemanproject/execution/actions/workflows/linux.yml/badge.svg) | ![MacOS build status](https://github.com/bemanproject/execution/actions/workflows/macos.yml/badge.svg) | ![Window build status](https://github.com/bemanproject/execution/actions/workflows/windows.yml/badge.svg) |

The following instructions build the library and the examples:

ln -s cmake/CMakeUserPresets.json .
cmake --workflow --list-presets
Available workflow presets:

"debug"
"release"
"gcc-debug"
"gcc-release"
"llvm-debug"
"llvm-release"
"appleclang-debug"
"appleclang-release"
"msvc-debug"
"msvc-release"


cmake --workflow --preset release
CXX=g++-15 cmake --workflow --preset release
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the README should use a super recent compiler in its general build instructions. If there is a section on how to override compilers, e.g., to use a recent compiler, it could be used as an example (although I would prefer to keep the README fairly empty and have enhanced instructions elsewhere).


The implementation compiles and passes tests using [clang](https://clang.llvm.org/),
[gcc](http://gcc.gnu.org), and [MSVC++](https://visualstudio.microsoft.com/vs/features/cplusplus/).
Expand Down
11 changes: 11 additions & 0 deletions cmake/presets/CMakeGenericPresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
"CMAKE_CXX_STANDARD_REQUIRED": true,
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
"CMAKE_SKIP_TEST_ALL_DEPENDENCY": false
},
"warnings": {
"dev": true,
"deprecated": true,
"uninitialized": true,
"unusedCli": true,
"systemVars": false
},
"errors": {
"dev": false,
"deprecated": true
}
}
]
Expand Down
7 changes: 0 additions & 7 deletions src/beman/execution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,6 @@ source_group("Header Files\\detail" FILES ${DETAIL_HEADER_FILES})

set_target_properties(${TARGET_NAME} PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON)

target_compile_features(
${TARGET_NAME}
PUBLIC
"$<$<COMPILE_FEATURES:cxx_std_26>:cxx_std_26>"
"$<$<NOT:$<COMPILE_FEATURES:cxx_std_26>>:cxx_std_23>"
)

if(NOT BEMAN_EXECUTION_ENABLE_INSTALL OR CMAKE_SKIP_INSTALL_RULES)
return()
endif()
Expand Down