Skip to content

Commit 36e4bb3

Browse files
authored
[v2.0.1] Internal changes (#7)
* Update CMake presets and CI script * Remove flags from ext * Fixup config flags, enable workflow_dispatch * Bump version
1 parent 55f1763 commit 36e4bb3

File tree

7 files changed

+159
-53
lines changed

7 files changed

+159
-53
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: ci-pr
2-
on: [pull_request]
2+
on: [pull_request, workflow_dispatch]
33
jobs:
44
format-check:
55
runs-on: ubuntu-latest
@@ -30,11 +30,11 @@ jobs:
3030
- name: init
3131
run: uname -m; sudo apt install -yqq ninja-build
3232
- name: configure
33-
run: export CXX=g++-14; cmake -S . --preset=default -B build
33+
run: cmake -S . --preset=ninja-gcc -B build -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
3434
- name: build debug
35-
run: cmake --build build --config=Debug
35+
run: cmake --build build --config=Debug -- -v
3636
- name: build release
37-
run: cmake --build build --config=Release
37+
run: cmake --build build --config=Release -- -v
3838
- name: test debug
3939
run: cd build && ctest -V -C Debug
4040
- name: test release
@@ -52,9 +52,9 @@ jobs:
5252
- name: configure
5353
run: cmake -S . --preset=ninja-clang -B build
5454
- name: build debug
55-
run: cmake --build build --config=Debug
55+
run: cmake --build build --config=Debug -- -v
5656
- name: build release
57-
run: cmake --build build --config=Release
57+
run: cmake --build build --config=Release -- -v
5858
- name: test debug
5959
run: cd build && ctest -V -C Debug
6060
- name: test release
@@ -66,11 +66,11 @@ jobs:
6666
- name: init
6767
run: uname -m
6868
- name: configure
69-
run: export CXX=g++-14; cmake -S . --preset=default -B build
69+
run: cmake -S . --preset=ninja-gcc -B build -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
7070
- name: build debug
71-
run: cmake --build build --config=Debug
71+
run: cmake --build build --config=Debug -- -v
7272
- name: build release
73-
run: cmake --build build --config=Release
73+
run: cmake --build build --config=Release -- -v
7474
- name: test debug
7575
run: cd build && ctest -V -C Debug
7676
- name: test release
@@ -88,9 +88,9 @@ jobs:
8888
- name: configure
8989
run: cmake -S . --preset=ninja-clang -B build
9090
- name: build debug
91-
run: cmake --build build --config=Debug
91+
run: cmake --build build --config=Debug -- -v
9292
- name: build release
93-
run: cmake --build build --config=Release
93+
run: cmake --build build --config=Release -- -v
9494
- name: test debug
9595
run: cd build && ctest -V -C Debug
9696
- name: test release
@@ -118,9 +118,9 @@ jobs:
118118
- name: configure
119119
run: cmake -S . --preset=ninja-clang -B clang
120120
- name: build debug
121-
run: cmake --build clang --config=Debug
121+
run: cmake --build clang --config=Debug -- -v
122122
- name: build release
123-
run: cmake --build clang --config=Release
123+
run: cmake --build clang --config=Release -- -v
124124
- name: test debug
125125
run: cd clang && ctest -V -C Debug
126126
- name: test release

CMakeLists.txt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,6 @@ option(CAPO_MA_DEBUG_OUTPUT "Enable miniaudio debug output" ${capo_is_top_level}
1616

1717
add_subdirectory(ext)
1818

19-
add_library(capo-warnings INTERFACE)
20-
add_library(capo::warnings ALIAS capo-warnings)
21-
22-
if(capo_is_top_level)
23-
if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL GNU)
24-
target_compile_options(capo-warnings INTERFACE
25-
-Wall -Wextra -Wpedantic -Wconversion -Werror=return-type
26-
)
27-
endif()
28-
29-
if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL GNU)
30-
target_compile_options(capo-warnings INTERFACE
31-
$<$<NOT:$<CONFIG:Debug>>:-Werror>
32-
)
33-
elseif(CMAKE_CXX_COMPILER_ID STREQUAL MSVC)
34-
target_compile_options(capo-warnings
35-
$<$<NOT:$<CONFIG:Debug>>:/WX>
36-
)
37-
endif()
38-
endif()
39-
4019
if(capo_is_top_level)
4120
configure_file(Doxyfile.in "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile" @ONLY)
4221
endif()

CMakePresets.json

Lines changed: 145 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,132 @@
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_INIT": "-Wall -Wextra -Wpedantic -Wconversion -Werror=return-type",
54+
"CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT": "-Werror",
55+
"CMAKE_CXX_FLAGS_RELEASE_INIT": "-Werror"
56+
}
57+
},
58+
{
59+
"name": "ninja-clang",
60+
"displayName": "Ninja Clang",
61+
"description": "Build configuration using Ninja Multi-config / Clang",
62+
"inherits": "base-clang",
63+
"binaryDir": "${sourceDir}/out/clang",
64+
"cacheVariables": {
65+
"CMAKE_CXX_FLAGS_INIT": "-Wall -Wextra -Wpedantic -Wconversion -Werror=return-type",
66+
"CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT": "-Werror",
67+
"CMAKE_CXX_FLAGS_RELEASE_INIT": "-Werror"
68+
}
69+
},
70+
{
71+
"name": "ninja-msvc",
72+
"displayName": "Ninja MSVC",
73+
"description": "Build configuration using Ninja Multi-config / MSVC",
74+
"inherits": "base-msvc",
75+
"binaryDir": "${sourceDir}/out/msvc",
76+
"cacheVariables": {
77+
"CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT": "/WX",
78+
"CMAKE_CXX_FLAGS_RELEASE_INIT": "/WX"
79+
}
80+
},
2881
{
2982
"name": "ninja-ubsan",
83+
"displayName": "Ninja UBSan",
3084
"description": "UBSan build configuration using Ninja Multi-config",
3185
"inherits": "default",
3286
"binaryDir": "${sourceDir}/out/ubsan",
3387
"cacheVariables": {
34-
"CMAKE_C_FLAGS": "-fsanitize=undefined",
35-
"CMAKE_CXX_FLAGS": "-fsanitize=undefined"
88+
"CMAKE_CXX_FLAGS_INIT": "-fsanitize=undefined -Wall -Wextra -Wpedantic -Wconversion -Werror=return-type"
3689
}
3790
},
3891
{
3992
"name": "ninja-asan",
93+
"displayName": "Ninja ASan",
4094
"description": "ASan build configuration using Ninja Multi-config",
4195
"inherits": "default",
4296
"binaryDir": "${sourceDir}/out/asan",
4397
"cacheVariables": {
44-
"CMAKE_C_FLAGS": "-fsanitize=address",
45-
"CMAKE_CXX_FLAGS": "-fsanitize=address"
98+
"CMAKE_CXX_FLAGS_INIT": "-fsanitize=address -Wall -Wextra -Wpedantic -Wconversion -Werror=return-type"
99+
}
100+
},
101+
{
102+
"name": "ninja-msvc-asan",
103+
"displayName": "Ninja MSVC ASan",
104+
"description": "ASan build configuration using Ninja Multi-config",
105+
"inherits": "base-msvc",
106+
"binaryDir": "${sourceDir}/out/asan",
107+
"cacheVariables": {
108+
"CMAKE_CXX_FLAGS_INIT": "-fsanitize=address"
46109
}
47110
},
48111
{
49112
"name": "ninja-tsan",
113+
"displayName": "Ninja TSan",
50114
"description": "TSan build configuration using Ninja Multi-config",
51115
"inherits": "default",
52116
"binaryDir": "${sourceDir}/out/tsan",
53117
"cacheVariables": {
54-
"CMAKE_C_FLAGS": "-fsanitize=thread",
55-
"CMAKE_CXX_FLAGS": "-fsanitize=thread"
118+
"CMAKE_CXX_FLAGS_INIT": "-fsanitize=thread -Wall -Wextra -Wpedantic -Wconversion -Werror=return-type"
56119
}
57120
},
58121
{
59122
"name": "vs22",
123+
"displayName": "Visual Studio 2022",
60124
"description": "Build configuration using Visual Studio 17 (2022)",
61125
"generator": "Visual Studio 17 2022",
62126
"binaryDir": "${sourceDir}/out/vs",
127+
"cacheVariables": {
128+
"CMAKE_CXX_FLAGS_INIT": "/WX"
129+
},
63130
"architecture": {
64131
"value": "x64",
65132
"strategy": "external"
@@ -82,6 +149,36 @@
82149
"configurePreset": "default",
83150
"configuration": "RelWithDebInfo"
84151
},
152+
{
153+
"name": "GCC Debug",
154+
"configurePreset": "ninja-gcc",
155+
"configuration": "Debug"
156+
},
157+
{
158+
"name": "GCC RelWithDebInfo",
159+
"configurePreset": "ninja-gcc",
160+
"configuration": "RelWithDebInfo"
161+
},
162+
{
163+
"name": "Clang Debug",
164+
"configurePreset": "ninja-clang",
165+
"configuration": "Debug"
166+
},
167+
{
168+
"name": "Clang RelWithDebInfo",
169+
"configurePreset": "ninja-clang",
170+
"configuration": "RelWithDebInfo"
171+
},
172+
{
173+
"name": "MSVC Debug",
174+
"configurePreset": "ninja-msvc",
175+
"configuration": "Debug"
176+
},
177+
{
178+
"name": "MSVC Release",
179+
"configurePreset": "ninja-msvc",
180+
"configuration": "Release"
181+
},
85182
{
86183
"name": "UBSan Debug",
87184
"configurePreset": "ninja-ubsan",
@@ -107,6 +204,42 @@
107204
"configuration": "RelWithDebInfo",
108205
"inheritConfigureEnvironment": true
109206
},
207+
{
208+
"name": "GCC Debug",
209+
"configurePreset": "ninja-gcc",
210+
"configuration": "Debug",
211+
"inheritConfigureEnvironment": true
212+
},
213+
{
214+
"name": "GCC RelWithDebInfo",
215+
"configurePreset": "ninja-gcc",
216+
"configuration": "RelWithDebInfo",
217+
"inheritConfigureEnvironment": true
218+
},
219+
{
220+
"name": "Clang Debug",
221+
"configurePreset": "ninja-clang",
222+
"configuration": "Debug",
223+
"inheritConfigureEnvironment": true
224+
},
225+
{
226+
"name": "Clang RelWithDebInfo",
227+
"configurePreset": "ninja-clang",
228+
"configuration": "RelWithDebInfo",
229+
"inheritConfigureEnvironment": true
230+
},
231+
{
232+
"name": "MSVC Debug",
233+
"configurePreset": "ninja-msvc",
234+
"configuration": "Debug",
235+
"inheritConfigureEnvironment": true
236+
},
237+
{
238+
"name": "MSVC Release",
239+
"configurePreset": "ninja-msvc",
240+
"configuration": "Release",
241+
"inheritConfigureEnvironment": true
242+
},
110243
{
111244
"name": "UBSan Debug",
112245
"configurePreset": "ninja-ubsan",

examples/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function(add_example ID)
77

88
target_link_libraries(capo-${ID} PRIVATE
99
capo::capo
10-
capo::warnings
1110
)
1211

1312
target_sources(capo-${ID} PRIVATE

ext/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,3 @@ set(MINIAUDIO_DEBUG_OUTPUT ${CAPO_MA_DEBUG_OUTPUT})
1212

1313
add_subdirectory(src/miniaudio)
1414
add_library(miniaudio::miniaudio ALIAS miniaudio)
15-
16-
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
17-
target_compile_options(miniaudio PRIVATE -w)
18-
endif()

lib/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ add_library(capo::capo ALIAS ${PROJECT_NAME})
99

1010
target_link_libraries(${PROJECT_NAME} PRIVATE
1111
miniaudio::miniaudio
12-
capo::warnings
1312
)
1413

1514
file(GLOB_RECURSE headers LIST_DIRECTORIES false "include/capo/*.hpp")

version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
set(capo_version "2.0.0")
1+
set(capo_version "2.0.1")

0 commit comments

Comments
 (0)