Skip to content

Commit 95b29e3

Browse files
committed
Update klib and capo
1 parent cc6ad69 commit 95b29e3

7 files changed

Lines changed: 164 additions & 32 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
- name: init
1010
run: uname -m; sudo apt update -yqq && sudo apt install -yqq ninja-build mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
1111
- name: configure
12-
run: export CC=gcc-14; export CXX=g++-14; cmake -S . --preset=default -B build -DGLFW_BUILD_X11=OFF
12+
run: cmake -S . --preset=ninja-gcc -B build -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
1313
- name: build debug
14-
run: cmake --build build --config=Debug
14+
run: cmake --build build --config=Debug -- -v
1515
- name: build release
16-
run: cmake --build build --config=Release
16+
run: cmake --build build --config=Release -- -v
1717
- name: test debug
1818
run: cd build && ctest -V -C Debug
1919
- name: test release
@@ -25,11 +25,11 @@ jobs:
2525
- name: init
2626
run: uname -m; sudo apt update -yqq && sudo apt install -yqq ninja-build mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
2727
- name: configure
28-
run: cmake -S . --preset=ninja-clang -B build -DGLFW_BUILD_X11=OFF
28+
run: cmake -S . --preset=ninja-clang -B build
2929
- name: build debug
30-
run: cmake --build build --config=Debug
30+
run: cmake --build build --config=Debug -- -v
3131
- name: build release
32-
run: cmake --build build --config=Release
32+
run: cmake --build build --config=Release -- -v
3333
- name: test debug
3434
run: cd build && ctest -V -C Debug
3535
- name: test release
@@ -41,11 +41,11 @@ jobs:
4141
- name: init
4242
run: uname -m; sudo apt update -yqq && sudo apt install -yqq ninja-build mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
4343
- name: configure
44-
run: export CC=gcc-14; export CXX=g++-14; cmake -S . --preset=default -B build -DGLFW_BUILD_X11=OFF
44+
run: cmake -S . --preset=ninja-gcc -B build -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
4545
- name: build debug
46-
run: cmake --build build --config=Debug
46+
run: cmake --build build --config=Debug -- -v
4747
- name: build release
48-
run: cmake --build build --config=Release
48+
run: cmake --build build --config=Release -- -v
4949
- name: test debug
5050
run: cd build && ctest -V -C Debug
5151
- name: test release
@@ -57,11 +57,11 @@ jobs:
5757
- name: init
5858
run: uname -m; sudo apt update -yqq && sudo apt install -yqq ninja-build mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
5959
- name: configure
60-
run: cmake -S . --preset=ninja-clang -B build -DGLFW_BUILD_X11=OFF
60+
run: cmake -S . --preset=ninja-clang -B build
6161
- name: build debug
62-
run: cmake --build build --config=Debug
62+
run: cmake --build build --config=Debug -- -v
6363
- name: build release
64-
run: cmake --build build --config=Release
64+
run: cmake --build build --config=Release -- -v
6565
- name: test debug
6666
run: cd build && ctest -V -C Debug
6767
- name: test release
@@ -89,9 +89,9 @@ jobs:
8989
- name: configure
9090
run: cmake -S . --preset=ninja-clang -B clang
9191
- name: build debug
92-
run: cmake --build clang --config=Debug
92+
run: cmake --build clang --config=Debug -- -v
9393
- name: build release
94-
run: cmake --build clang --config=Release
94+
run: cmake --build clang --config=Release -- -v
9595
- name: test debug
9696
run: cd clang && ctest -V -C Debug
9797
- name: test release

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
2323
gvdi::gvdi
2424
capo::capo
2525
klib::klib
26-
capo::warnings
27-
klib::klib-ndwerror
2826
icons::kenny
2927
)
3028

CMakePresets.json

Lines changed: 144 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,131 @@
11
{
2-
"version": 2,
2+
"version": 5,
33
"cmakeMinimumRequired": {
44
"major": 3,
5-
"minor": 20,
5+
"minor": 24,
66
"patch": 0
77
},
88
"configurePresets": [
99
{
1010
"name": "default",
11-
"description": "Build configuration using Ninja Multi-config",
11+
"displayName": "Default Config",
12+
"description": "Base configuration using Ninja Multi-config",
1213
"generator": "Ninja Multi-Config",
1314
"binaryDir": "${sourceDir}/out/default",
1415
"cacheVariables": {
1516
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
1617
}
1718
},
1819
{
19-
"name": "ninja-clang",
20-
"description": "Build configuration using Ninja Multi-config / clang",
20+
"name": "base-gcc",
21+
"hidden": true,
22+
"inherits": "default",
23+
"cacheVariables": {
24+
"CMAKE_C_COMPILER": "gcc",
25+
"CMAKE_CXX_COMPILER": "g++"
26+
}
27+
},
28+
{
29+
"name": "base-clang",
30+
"hidden": true,
2131
"inherits": "default",
22-
"binaryDir": "${sourceDir}/out/clang",
2332
"cacheVariables": {
2433
"CMAKE_C_COMPILER": "clang",
2534
"CMAKE_CXX_COMPILER": "clang++"
2635
}
2736
},
37+
{
38+
"name": "base-msvc",
39+
"hidden": true,
40+
"inherits": "default",
41+
"cacheVariables": {
42+
"CMAKE_C_COMPILER": "cl",
43+
"CMAKE_CXX_COMPILER": "cl"
44+
}
45+
},
46+
{
47+
"name": "ninja-gcc",
48+
"displayName": "Ninja GCC",
49+
"description": "Build configuration using Ninja Multi-config / GCC",
50+
"inherits": "base-gcc",
51+
"binaryDir": "${sourceDir}/out/gcc",
52+
"cacheVariables": {
53+
"CMAKE_CXX_FLAGS_DEBUG_INIT": "-Wall -Wextra -Wpedantic -Werror=return-type",
54+
"CMAKE_CXX_FLAGS_INIT": "-Wall -Wextra -Wpedantic -Werror"
55+
}
56+
},
57+
{
58+
"name": "ninja-clang",
59+
"displayName": "Ninja Clang",
60+
"description": "Build configuration using Ninja Multi-config / Clang",
61+
"inherits": "base-clang",
62+
"binaryDir": "${sourceDir}/out/clang",
63+
"cacheVariables": {
64+
"CMAKE_CXX_FLAGS_DEBUG_INIT": "-Wall -Wextra -Wpedantic -Werror=return-type",
65+
"CMAKE_CXX_FLAGS_INIT": "-Wall -Wextra -Wpedantic -Werror"
66+
}
67+
},
68+
{
69+
"name": "ninja-msvc",
70+
"displayName": "Ninja MSVC",
71+
"description": "Build configuration using Ninja Multi-config / MSVC",
72+
"inherits": "base-msvc",
73+
"binaryDir": "${sourceDir}/out/msvc",
74+
"cacheVariables": {
75+
"CMAKE_CXX_FLAGS_INIT": "/WX"
76+
}
77+
},
2878
{
2979
"name": "ninja-ubsan",
80+
"displayName": "Ninja UBSan",
3081
"description": "UBSan build configuration using Ninja Multi-config",
3182
"inherits": "default",
3283
"binaryDir": "${sourceDir}/out/ubsan",
3384
"cacheVariables": {
34-
"CMAKE_C_FLAGS": "-fsanitize=undefined",
35-
"CMAKE_CXX_FLAGS": "-fsanitize=undefined"
85+
"CMAKE_CXX_FLAGS_DEBUG_INIT": "-fsanitize=undefined -Wall -Wextra -Wpedantic -Werror=return-type",
86+
"CMAKE_CXX_FLAGS_INIT": "-fsanitize=undefined -Wall -Wextra -Wpedantic -Werror"
3687
}
3788
},
3889
{
3990
"name": "ninja-asan",
91+
"displayName": "Ninja ASan",
4092
"description": "ASan build configuration using Ninja Multi-config",
4193
"inherits": "default",
4294
"binaryDir": "${sourceDir}/out/asan",
4395
"cacheVariables": {
44-
"CMAKE_C_FLAGS": "-fsanitize=address",
45-
"CMAKE_CXX_FLAGS": "-fsanitize=address"
96+
"CMAKE_CXX_FLAGS_DEBUG_INIT": "-fsanitize=address -Wall -Wextra -Wpedantic -Werror=return-type",
97+
"CMAKE_CXX_FLAGS_INIT": "-fsanitize=address -Wall -Wextra -Wpedantic -Werror"
98+
}
99+
},
100+
{
101+
"name": "ninja-msvc-asan",
102+
"displayName": "Ninja MSVC ASan",
103+
"description": "ASan build configuration using Ninja Multi-config",
104+
"inherits": "base-msvc",
105+
"binaryDir": "${sourceDir}/out/asan",
106+
"cacheVariables": {
107+
"CMAKE_CXX_FLAGS_INIT": "-fsanitize=address"
46108
}
47109
},
48110
{
49111
"name": "ninja-tsan",
112+
"displayName": "Ninja TSan",
50113
"description": "TSan build configuration using Ninja Multi-config",
51114
"inherits": "default",
52115
"binaryDir": "${sourceDir}/out/tsan",
53116
"cacheVariables": {
54-
"CMAKE_C_FLAGS": "-fsanitize=thread",
55-
"CMAKE_CXX_FLAGS": "-fsanitize=thread"
117+
"CMAKE_CXX_FLAGS_INIT": "-fsanitize=thread -Wall -Wextra -Wpedantic -Werror=return-type"
56118
}
57119
},
58120
{
59121
"name": "vs22",
122+
"displayName": "Visual Studio 2022",
60123
"description": "Build configuration using Visual Studio 17 (2022)",
61124
"generator": "Visual Studio 17 2022",
62125
"binaryDir": "${sourceDir}/out/vs",
126+
"cacheVariables": {
127+
"CMAKE_CXX_FLAGS_INIT": "/WX"
128+
},
63129
"architecture": {
64130
"value": "x64",
65131
"strategy": "external"
@@ -82,6 +148,36 @@
82148
"configurePreset": "default",
83149
"configuration": "RelWithDebInfo"
84150
},
151+
{
152+
"name": "GCC Debug",
153+
"configurePreset": "ninja-gcc",
154+
"configuration": "Debug"
155+
},
156+
{
157+
"name": "GCC RelWithDebInfo",
158+
"configurePreset": "ninja-gcc",
159+
"configuration": "RelWithDebInfo"
160+
},
161+
{
162+
"name": "Clang Debug",
163+
"configurePreset": "ninja-clang",
164+
"configuration": "Debug"
165+
},
166+
{
167+
"name": "Clang RelWithDebInfo",
168+
"configurePreset": "ninja-clang",
169+
"configuration": "RelWithDebInfo"
170+
},
171+
{
172+
"name": "MSVC Debug",
173+
"configurePreset": "ninja-msvc",
174+
"configuration": "Debug"
175+
},
176+
{
177+
"name": "MSVC Release",
178+
"configurePreset": "ninja-msvc",
179+
"configuration": "Release"
180+
},
85181
{
86182
"name": "UBSan Debug",
87183
"configurePreset": "ninja-ubsan",
@@ -107,6 +203,42 @@
107203
"configuration": "RelWithDebInfo",
108204
"inheritConfigureEnvironment": true
109205
},
206+
{
207+
"name": "GCC Debug",
208+
"configurePreset": "ninja-gcc",
209+
"configuration": "Debug",
210+
"inheritConfigureEnvironment": true
211+
},
212+
{
213+
"name": "GCC RelWithDebInfo",
214+
"configurePreset": "ninja-gcc",
215+
"configuration": "RelWithDebInfo",
216+
"inheritConfigureEnvironment": true
217+
},
218+
{
219+
"name": "Clang Debug",
220+
"configurePreset": "ninja-clang",
221+
"configuration": "Debug",
222+
"inheritConfigureEnvironment": true
223+
},
224+
{
225+
"name": "Clang RelWithDebInfo",
226+
"configurePreset": "ninja-clang",
227+
"configuration": "RelWithDebInfo",
228+
"inheritConfigureEnvironment": true
229+
},
230+
{
231+
"name": "MSVC Debug",
232+
"configurePreset": "ninja-msvc",
233+
"configuration": "Debug",
234+
"inheritConfigureEnvironment": true
235+
},
236+
{
237+
"name": "MSVC Release",
238+
"configurePreset": "ninja-msvc",
239+
"configuration": "Release",
240+
"inheritConfigureEnvironment": true
241+
},
110242
{
111243
"name": "UBSan Debug",
112244
"configurePreset": "ninja-ubsan",

ext/src.zip

965 Bytes
Binary file not shown.

src/app.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void App::create_player() {
9191
}
9292

9393
void App::create_context() {
94-
auto const title = std::format("riff {}", klib::to_string(build_version_v));
94+
auto const title = std::format("riff {}", build_version_str);
9595
auto window = gvdi::Context::create_window({500.0f, 350.0f}, title.c_str());
9696
if (!window) { throw std::runtime_error{"Failed to create Window"}; }
9797

src/build_version.hpp.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#pragma once
2-
#include <klib/version.hpp>
2+
#include <klib/version_str.hpp>
33

44
namespace riff {
55
inline constexpr auto build_version_v = klib::Version{
66
.major = @PROJECT_VERSION_MAJOR@,
77
.minor= @PROJECT_VERSION_MINOR@,
88
.patch = @PROJECT_VERSION_PATCH@,
99
};
10+
11+
auto const build_version_str = std::format("{}", build_version_v);
1012
} // namespace riff

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
#include <build_version.hpp>
33
#include <klib/args/parse.hpp>
44
#include <klib/version_str.hpp>
5+
#include <format>
56
#include <print>
67

78
auto main(int argc, char** argv) -> int {
89
try {
9-
auto const version = klib::to_string(riff::build_version_v);
1010
auto const app_info = klib::args::ParseInfo{
1111
.help_text = "riff: audio player demo using capo-lite",
12-
.version = version,
12+
.version = riff::build_version_str,
1313
};
1414
auto const parse_result = klib::args::parse_main(app_info, {}, argc, argv);
1515
if (parse_result.early_return()) { return parse_result.get_return_code(); }

0 commit comments

Comments
 (0)