Skip to content

Commit a760a29

Browse files
authored
Merge pull request #62 from ClausKlein/feature/prepare-cmake-workflow-presets
2 parents 28b8aee + d8fb010 commit a760a29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+483
-194
lines changed

.clang-tidy

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Checks:
2+
'-*,
3+
boost-*,
4+
bugprone-*,
5+
cert-*,
6+
-cert-dcl58-cpp,
7+
clang-analyzer-*,
8+
concurrency-*,
9+
-cppcoreguidelines-*,
10+
-google-*,
11+
hicpp-*,
12+
misc-*,
13+
-misc-const-correctness,
14+
-misc-include-cleaner,
15+
-misc-non-private-member-variables-in-classes,
16+
-modernize-*,
17+
-modernize-use-nodiscard,
18+
performance-*,
19+
portability-*,
20+
-readability-*,
21+
-readability-identifier-*,
22+
-readability-implicit-bool-conversion,
23+
-readability-magic-numbers,
24+
-*-named-parameter,
25+
-*-uppercase-literal-suffix,
26+
-*-use-equals-default,
27+
-*-braces-around-statements
28+
'
29+
HeaderFilterRegex: '.*/execution26/(include|src|example|tests)/.*\.(hpp)$'
30+
WarningsAsErrors: 'clang*'
31+
FormatStyle: file
32+
33+
CheckOptions:
34+
- { key: readability-identifier-naming.NamespaceCase, value: CamelCase }
35+
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
36+
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
37+
- { key: readability-identifier-naming.MemberCase, value: camelBack }
38+
- { key: readability-identifier-naming.MemberPrefix, value: m_ }
39+
- { key: readability-identifier-naming.StructCase, value: lower_case }
40+
- { key: readability-identifier-naming.UnionCase, value: lower_case }
41+
- { key: readability-identifier-naming.TypedefCase, value: lower_case }
42+
- { key: readability-identifier-naming.TypedefSuffix, value: _type }
43+
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
44+
- { key: readability-identifier-naming.VariableCase, value: camelBack }
45+
- { key: readability-identifier-naming.ParameterCase, value: camelBack }
46+
- { key: readability-identifier-naming.LocalVariableCase, value: camelBack }
47+
- { key: readability-identifier-naming.ConstexprFunctionCase, value: camelBack }
48+
- { key: readability-identifier-naming.ConstexprMethodCase, value: camelBack }
49+
- { key: readability-identifier-naming.ConstexprVariableCase, value: UPPER_CASE }
50+
- { key: readability-identifier-naming.ClassConstantCase, value: UPPER_CASE }
51+
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
52+
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
53+
- { key: readability-identifier-naming.GlobalConstantPointerCase, value: UPPER_CASE }
54+
- { key: readability-identifier-naming.LocalConstantPointerCase, value: UPPER_CASE }
55+
- { key: readability-identifier-naming.ScopedEnumConstantCase, value: UPPER_CASE }
56+
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }

.codespellrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[codespell]
2+
builtin = clear,rare,en-GB_to_en-US,names,informal,code
3+
check-hidden =
4+
skip = ./.git,./build/*,./stagedir/*,./docs/html/*,./docs/latex/*,*.log,.*.swp,*~,*.bak,Makefile
5+
quiet-level = 2
6+
# ignore-words = .ignore-words

.github/workflows/linux.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ name: Linux Build
55

66
on:
77
push:
8-
# branches: [ "main" ]
8+
branches: ["main"]
99
paths:
1010
- "include/**"
1111
- "src/**"
1212
- "test/**"
1313
- "CMakeLists.txt"
1414
- ".github/workflows/linux.yml"
1515
pull_request:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
paths:
1818
- "include/**"
1919
- "src/**"
@@ -30,19 +30,17 @@ jobs:
3030
matrix:
3131
# TODO: sanitizer: [debug, release, asan, usan, tsan]
3232
sanitizer: [debug, release]
33-
# TODO: compiler: [g++-14, clang++-18]
34-
compiler: [g++-14]
33+
compiler: [g++-14, clang++-19]
3534

3635
steps:
3736
- uses: actions/checkout@v4
3837

39-
- name: Install static analyzers
40-
run: >-
41-
sudo apt-get install clang-tidy-18 ninja-build -y -q
42-
43-
sudo update-alternatives --install
44-
/usr/bin/clang-tidy clang-tidy
45-
/usr/bin/clang-tidy-18 140
38+
- name: Install build tools
39+
run: |
40+
sudo apt-get install ninja-build -y -q
41+
wget https://apt.llvm.org/llvm.sh
42+
chmod +x llvm.sh
43+
sudo ./llvm.sh 19 all
4644
4745
- name: Linux ${{ matrix.compiler }} ${{ matrix.sanitizer }}
4846
run: CXX=${{ matrix.compiler }} make ${{ matrix.sanitizer }}

.github/workflows/macos.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ name: Macos Build
55

66
on:
77
push:
8-
# branches: [ "main" ]
8+
branches: ["main"]
99
paths:
1010
- "include/**"
1111
- "src/**"
1212
- "test/**"
1313
- "CMakeLists.txt"
1414
- ".github/workflows/macos.yml"
1515
pull_request:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
paths:
1818
- "include/**"
1919
- "src/**"
@@ -29,8 +29,8 @@ jobs:
2929

3030
matrix:
3131
sanitizer: [debug, release]
32-
# TODO: compiler: [g++-14, clang++-19]
33-
compiler: [clang++-18]
32+
# TODO: compiler: [g++, clang++-19]
33+
compiler: [g++, clang++-18]
3434

3535
steps:
3636
- uses: actions/checkout@v4
@@ -39,11 +39,20 @@ jobs:
3939
# if: startsWith(matrix.compiler, 'clang')
4040
uses: aminya/setup-cpp@v1
4141
with:
42-
# compiler: llvm-19
42+
# TODO: compiler: llvm-19
4343
# clangtidy: true
4444
# cmake: true
4545
ninja: true
4646

47-
- name: macos ${{ matrix.compiler }} ${{ matrix.sanitizer }}
47+
- name: Install llvm-19
48+
if: startsWith(matrix.compiler, 'clang')
49+
run: |
50+
brew install llvm@19 || echo ignored
51+
52+
- name: macos clang++-18 ${{ matrix.sanitizer }}
4853
if: startsWith(matrix.compiler, 'clang')
4954
run: CXX=$(brew --prefix llvm@18)/bin/clang++ make ${{ matrix.sanitizer }}
55+
56+
- name: macos g++ ${{ matrix.sanitizer }}
57+
if: startsWith(matrix.compiler, 'g++')
58+
run: CXX=${{ matrix.compiler }} make ${{ matrix.sanitizer }}

.github/workflows/windows.yml

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ name: Windows Build
55

66
on:
77
push:
8-
# branches: [ "main" ]
8+
branches: ["main"]
99
paths:
1010
- "include/**"
1111
- "src/**"
1212
- "test/**"
1313
- "CMakeLists.txt"
1414
- ".github/workflows/windows.yml"
1515
pull_request:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
paths:
1818
- "include/**"
1919
- "src/**"
@@ -24,20 +24,38 @@ on:
2424
jobs:
2525
build:
2626
runs-on: windows-latest
27+
strategy:
28+
fail-fast: false
29+
30+
matrix:
31+
# TODO: sanitizer: [debug, release]
32+
sanitizer: [release]
33+
# TODO: compiler: [cl, clang-cl]
34+
compiler: [cl]
35+
2736
steps:
2837
- uses: actions/checkout@v4
2938

30-
- name: environment
31-
run: cmake -E make_directory ${{github.workspace}}/build
39+
# see https://github.com/marketplace/actions/enable-developer-command-prompt
40+
- uses: ilammy/msvc-dev-cmd@v1
41+
with:
42+
vsversion: 2022
43+
44+
# - name: build environment
45+
# run: pip install -r requirements.txt
46+
47+
- name: cmake workflow ${{ matrix.sanitizer }}
48+
shell: bash
49+
run: |
50+
cmake --version
51+
ninja --version
52+
CXX=${{ matrix.compiler }} cmake --workflow --preset ${{ matrix.sanitizer }}
3253
33-
- name: configure
34-
working-directory: ${{github.workspace}}/build
35-
run: cmake ${{github.workspace}}
54+
# - name: configure
55+
# run: CXX=${{ matrix.compiler }} cmake --preset ${{ matrix.sanitizer }}
3656

37-
- name: build
38-
working-directory: ${{github.workspace}}/build
39-
run: cmake --build . --config Release --target all_verify_interface_header_sets install
57+
# - name: build
58+
# run: cmake --build --preset ${{ matrix.sanitizer }}
4059

41-
- name: ctest
42-
working-directory: ${{github.workspace}}/build
43-
run: ctest --build-config Release --output-on-failure
60+
# - name: ctest
61+
# run: ctest --preset ${{ matrix.sanitizer }}

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,10 @@ build
3636
.vs
3737
.vscode
3838
stagedir
39+
40+
# In-source builds are not allowed
41+
CMakeCache.txt
42+
CMakeFiles/
43+
3944
docs/html
40-
docs/latex
45+
docs/latex

CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@ set(TARGET_ALIAS ${TARGET_LIBRARY}::${TARGET_LIBRARY})
1515
set(TARGET_PACKAGE_NAME ${PROJECT_NAME}-config)
1616
set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-targets)
1717

18-
include(GNUInstallDirs)
19-
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
20-
21-
if(NOT DEFINED CMAKE_CXX_STANDARD)
22-
set(CMAKE_CXX_STANDARD 23)
18+
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
19+
message(FATAL_ERROR "In-source builds are not allowed!")
2320
endif()
2421

25-
if(NOT DEFINED CMAKE_PREFIX_PATH)
26-
set(CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
27-
endif()
22+
include(GNUInstallDirs)
23+
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
2824

2925
add_subdirectory(src/beman/execution26)
3026

@@ -53,3 +49,5 @@ install(
5349
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-version.cmake
5450
DESTINATION ${INSTALL_CONFIGDIR}
5551
)
52+
53+
include(CPack)

CMakePresets.json

Lines changed: 28 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,27 @@
11
{
2-
"version": 6,
3-
"configurePresets": [
4-
{
5-
"name": "root-config",
6-
"hidden": true,
7-
"generator": "Ninja",
8-
"binaryDir": "${sourceDir}/build/${presetName}",
9-
"installDir": "${sourceDir}/stagedir",
10-
"cacheVariables": {
11-
"CMAKE_PREFIX_PATH": {
12-
"type": "path",
13-
"value": "${sourceDir}/stagedir"
14-
},
15-
"CMAKE_CXX_EXTENSIONS": false,
16-
"CMAKE_CXX_STANDARD": "23",
17-
"CMAKE_CXX_STANDARD_REQUIRED": true,
18-
"CMAKE_EXPORT_COMPILE_COMMANDS": true
19-
}
20-
},
21-
{
22-
"name": "debug-base-unix",
23-
"hidden": true,
24-
"cacheVariables": {
25-
"CMAKE_BUILD_TYPE": "Debug",
26-
"CMAKE_CXX_FLAGS": "-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=leak -fsanitize=undefined"
27-
},
28-
"condition": {
29-
"type": "notEquals",
30-
"lhs": "${hostSystemName}",
31-
"rhs": "Windows"
32-
}
33-
},
34-
{
35-
"name": "release-base-unix",
36-
"hidden": true,
37-
"cacheVariables": {
38-
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
39-
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wno-shadow -Wconversion -Wsign-conversion -Wcast-align -Wcast-qual -Woverloaded-virtual -Wformat=2 -Wno-error"
40-
},
41-
"condition": {
42-
"type": "notEquals",
43-
"lhs": "${hostSystemName}",
44-
"rhs": "Windows"
45-
}
46-
},
47-
{
48-
"name": "debug",
49-
"displayName": "Debug Build",
50-
"inherits": [
51-
"root-config",
52-
"debug-base-unix"
53-
]
54-
},
55-
{
56-
"name": "release",
57-
"displayName": "Release Build",
58-
"inherits": [
59-
"root-config",
60-
"release-base-unix"
61-
]
62-
}
2+
"version": 9,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 30,
6+
"patch": 0
7+
},
8+
"include": [
9+
"cmake/CMake${hostSystemName}Presets.json"
6310
],
6411
"buildPresets": [
6512
{
6613
"name": "debug",
6714
"configurePreset": "debug",
15+
"configuration": "Debug",
6816
"targets": [
69-
"all",
7017
"install"
7118
]
7219
},
7320
{
7421
"name": "release",
7522
"configurePreset": "release",
23+
"configuration": "Release",
7624
"targets": [
77-
"all",
7825
"all_verify_interface_header_sets",
7926
"install"
8027
]
@@ -95,14 +42,28 @@
9542
{
9643
"name": "debug",
9744
"inherits": "test_base",
45+
"configuration": "Debug",
9846
"configurePreset": "debug"
9947
},
10048
{
10149
"name": "release",
10250
"inherits": "test_base",
51+
"configuration": "Release",
10352
"configurePreset": "release"
10453
}
10554
],
55+
"packagePresets": [
56+
{
57+
"name": "release",
58+
"configurePreset": "release",
59+
"configurations": [
60+
"Release"
61+
],
62+
"generators": [
63+
"TGZ"
64+
]
65+
}
66+
],
10667
"workflowPresets": [
10768
{
10869
"name": "debug",
@@ -135,6 +96,10 @@
13596
{
13697
"type": "test",
13798
"name": "release"
99+
},
100+
{
101+
"type": "package",
102+
"name": "release"
138103
}
139104
]
140105
}

0 commit comments

Comments
 (0)