You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is mainly tested on `Ubuntu 22.04` and `Ubuntu 24.04`, but it should be as portable as CMake is. This project has zero C or C++ dependencies.
56
+
This project is mainly tested on `Ubuntu 22.04` and `Ubuntu 24.04`, but it should be as portable as CMake is. This
57
+
project has no C or C++ dependencies.
32
58
33
-
It does require few tools as build-time dependencies:
59
+
Build-time dependencies:
34
60
35
-
-`cmake`
36
-
-`ninja`, `make`, or another CMake-supported build system
37
-
- CMake defaults to "Unix Makefiles" on POSIX systems
61
+
*`cmake`
62
+
*`ninja`, `make`, or another CMake-supported build system
63
+
* CMake defaults to "Unix Makefiles" on POSIX systems
38
64
39
65
Example of installation on `Ubuntu 24.04`:
66
+
40
67
```shell
41
-
#install tools
68
+
#Install tools:
42
69
apt-get install -y cmake make ninja-build
43
70
44
-
# example of toolchains
45
-
apt-get install g++-14 gcc-14 clang-18 clang++-18
71
+
# Example of toolchains:
72
+
apt-get install \
73
+
g++-14 gcc-14 gcc-13 g++-14 \
74
+
clang-18 clang++-18 clang-17 clang++-17
46
75
```
47
76
48
77
### Instructions
49
78
50
-
Full set of supported toolchains can be found in [.github/workflows/ci.yml](#.github/workflows/ci.yml).
51
-
52
-
#### Basic Build
79
+
#### Preset CMake Flows
53
80
54
-
This project strives to be as normal and simple a CMake project as possible. This build workflow in particular will work, producing a static `beman_optional26` library, ready to package:
81
+
This project strives to be as normal and simple a CMake project as possible. This build workflow in particular will
82
+
work, producing a static `beman.iterator_interface` library, ready to package:
55
83
56
84
```shell
57
-
cmake --workflow --preset gcc-14
85
+
$ cmake --workflow --list-presets
86
+
Available workflow presets:
87
+
"system"
88
+
"gcc-14"
89
+
"gcc-13"
90
+
"gcc-12"
91
+
"clang-20"
92
+
"clang-19"
93
+
"clang-18"
94
+
"clang-17"
95
+
"clang-16
96
+
97
+
# Run examples:
98
+
$ cmake --workflow --preset gcc-14
99
+
Executing workflow step 1 of 3: configure preset "gcc-14"
100
+
...
101
+
-- Build files have been written to: /path/to/repo/.build/gcc-14
102
+
103
+
Executing workflow step 2 of 3: build preset "gcc-14"
104
+
105
+
ninja: no work to do.
106
+
107
+
Executing workflow step 3 of 3: test preset "gcc-14"
108
+
109
+
Test project /home/dariusn/git/Beman/iterator_interface/.build/gcc-14
110
+
Start 1: IteratorTest.TestGTest
111
+
1/4 Test #1: IteratorTest.TestGTest ........... Passed 0.00 sec
112
+
Start 2: IteratorTest.TestRepeatedChars
113
+
2/4 Test #2: IteratorTest.TestRepeatedChars ... Passed 0.00 sec
114
+
Start 3: IteratorTest.TestFilteredIter
115
+
3/4 Test #3: IteratorTest.TestFilteredIter .... Passed 0.00 sec
116
+
Start 4: IteratorTest.OperatorArrow
117
+
4/4 Test #4: IteratorTest.OperatorArrow ....... Passed 0.00 sec
118
+
...
119
+
120
+
100% tests passed, 0 tests failed out of ...
121
+
122
+
Total Test time (real) = 0.09 sec
58
123
```
59
124
60
125
This should build and run the tests with GCC 14 with the address and undefined behavior sanitizers enabled.
61
126
62
-
#### More complex cases
127
+
#### Custom CMake Flows
63
128
64
-
The CMake preset system suffers from combinitorial explosion. There is a makefile in the root of the repository to aid in running more configurations.
129
+
##### Default Build
130
+
131
+
CI current build and test flows:
65
132
66
133
```shell
67
-
make -k TOOLCHAIN=clang-18 CONFIG=Tsan VERBOSE=1
134
+
# Configure build: default build production code + tests (BEMAN_ITERATOR_INTERFACE_BUILD_TESTING=ON).
$ ctest --build-config Asan --output-on-failure --test-dir .build
150
+
Internal ctest changing into directory: /path/to/repo/.build
151
+
Test project /path/to/repo/.build
152
+
...
153
+
100% tests passed, 0 tests failed out of 82
154
+
155
+
Total Test time (real) = 0.67 sec
68
156
```
69
157
70
-
The makefile will use your system compiler, `c++`, if no toolchain name is provided, otherwise it will use the toolchain in the etc/ directory to perform the build. The Ninja multi config generator is used, with configurations for `RelWithDebugInfo`, `Debug`, `Tsan`, and `Asan` configured by default.
158
+
##### Build Production, but Skip Tests
159
+
160
+
By default, we build and run tests. You can provide `-DBEMAN_ITERATOR_INTERFACE_BUILD_TESTING=OFF` and completely disable building tests:
161
+
162
+
```shell
163
+
# Configure build: build production code, skip tests (BEMAN_ITERATOR_INTERFACE_BUILD_TESTING=OFF).
0 commit comments