Skip to content

Commit fa6d441

Browse files
authored
Update the README.md and Makefile (#171)
1 parent d4236a1 commit fa6d441

File tree

6 files changed

+53
-15
lines changed

6 files changed

+53
-15
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222

2323
# CMake linting and formatting
2424
- repo: https://github.com/BlankSpruce/gersemi
25-
rev: 0.20.0
25+
rev: 0.20.1
2626
hooks:
2727
- id: gersemi
2828
name: CMake linting

CMakePresets.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@
102102
],
103103
"cacheVariables": {
104104
"CMAKE_TOOLCHAIN_FILE": "infra/cmake/msvc-toolchain.cmake"
105+
},
106+
"condition": {
107+
"type": "equals",
108+
"lhs": "${hostSystemName}",
109+
"rhs": "Windows"
105110
}
106111
},
107112
{
@@ -113,6 +118,11 @@
113118
],
114119
"cacheVariables": {
115120
"CMAKE_TOOLCHAIN_FILE": "infra/cmake/msvc-toolchain.cmake"
121+
},
122+
"condition": {
123+
"type": "equals",
124+
"lhs": "${hostSystemName}",
125+
"rhs": "Windows"
116126
}
117127
}
118128
],

Makefile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ BUILDROOT = build
3737
SYSTEM = $(shell uname -s)
3838
BUILD = $(BUILDROOT)/$(SYSTEM)/$(SANITIZER)
3939
EXAMPLE = beman.execution.examples.stop_token
40-
CMAKE_CXX_COMPILER=$(COMPILER)
40+
41+
export CXX=$(COMPILER)
4142

4243
ifeq ($(SANITIZER),release)
4344
CXX_FLAGS = -O3 -Wpedantic -Wall -Wextra -Wno-shadow -Werror
@@ -79,9 +80,10 @@ doc:
7980
# $(MAKE) SANITIZER=$@
8081

8182
build:
82-
CC=$(CXX) cmake --fresh -G Ninja -S $(SOURCEDIR) -B $(BUILD) $(TOOLCHAIN) $(SYSROOT) \
83+
cmake --fresh -G Ninja -S $(SOURCEDIR) -B $(BUILD) $(TOOLCHAIN) $(SYSROOT) \
8384
-D CMAKE_EXPORT_COMPILE_COMMANDS=1 \
8485
-D CMAKE_SKIP_INSTALL_RULES=1 \
86+
-D CMAKE_CXX_STANDARD=23 \
8587
-D CMAKE_CXX_COMPILER=$(CXX) # XXX -D CMAKE_CXX_FLAGS="$(CXX_FLAGS) $(SAN_FLAGS)"
8688
cmake --build $(BUILD)
8789

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

95-
release:
96-
cmake --workflow --preset $@ --fresh
97+
CMakeUserPresets.json: cmake/CMakeUserPresets.json
98+
ln -s $< $@
99+
100+
release: CMakeUserPresets.json
101+
cmake --preset $@ --fresh --log-level=TRACE
102+
cmake --workflow --preset $@
97103

98-
debug:
99-
cmake --workflow --preset $@ --fresh
104+
debug: CMakeUserPresets.json
105+
cmake --preset $@ --fresh --log-level=TRACE
106+
cmake --workflow --preset $@
100107

101108
ce:
102109
@mkdir -p $(BUILD)

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,36 @@ contains some links for general information about the sender/receivers and `std:
5252

5353
## Build
5454

55+
## Precondisions
56+
57+
- cmake v3.30 or newer
58+
- ninja v1.11.1 or newer
59+
- A compiler that supports at least C++23
60+
61+
5562
| Library | Linux | MacOS | Windows |
5663
| ------- | ----- | ----- | ------- |
5764
| 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) |
5865

5966
The following instructions build the library and the examples:
6067

68+
ln -s cmake/CMakeUserPresets.json .
6169
cmake --workflow --list-presets
6270
Available workflow presets:
6371

6472
"debug"
6573
"release"
74+
"gcc-debug"
75+
"gcc-release"
76+
"llvm-debug"
77+
"llvm-release"
78+
"appleclang-debug"
79+
"appleclang-release"
80+
"msvc-debug"
81+
"msvc-release"
82+
6683

67-
cmake --workflow --preset release
84+
CXX=g++-15 cmake --workflow --preset release
6885

6986
The implementation compiles and passes tests using [clang](https://clang.llvm.org/),
7087
[gcc](http://gcc.gnu.org), and [MSVC++](https://visualstudio.microsoft.com/vs/features/cplusplus/).

cmake/presets/CMakeGenericPresets.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@
1717
"CMAKE_CXX_STANDARD_REQUIRED": true,
1818
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
1919
"CMAKE_SKIP_TEST_ALL_DEPENDENCY": false
20+
},
21+
"warnings": {
22+
"dev": true,
23+
"deprecated": true,
24+
"uninitialized": true,
25+
"unusedCli": true,
26+
"systemVars": false
27+
},
28+
"errors": {
29+
"dev": false,
30+
"deprecated": true
2031
}
2132
}
2233
]

src/beman/execution/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,6 @@ source_group("Header Files\\detail" FILES ${DETAIL_HEADER_FILES})
199199

200200
set_target_properties(${TARGET_NAME} PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON)
201201

202-
target_compile_features(
203-
${TARGET_NAME}
204-
PUBLIC
205-
"$<$<COMPILE_FEATURES:cxx_std_26>:cxx_std_26>"
206-
"$<$<NOT:$<COMPILE_FEATURES:cxx_std_26>>:cxx_std_23>"
207-
)
208-
209202
if(NOT BEMAN_EXECUTION_ENABLE_INSTALL OR CMAKE_SKIP_INSTALL_RULES)
210203
return()
211204
endif()

0 commit comments

Comments
 (0)