Skip to content

Commit 50dbc9e

Browse files
committed
For release, do not treat warnings as errors
1 parent d573f33 commit 50dbc9e

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Release
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: ["main"]
88

99
env:
1010
BUILD_TYPE: Release
@@ -13,15 +13,15 @@ jobs:
1313
build:
1414
strategy:
1515
matrix:
16-
os: [ macos-14, ubuntu-latest, windows-latest ]
16+
os: [macos-14, ubuntu-latest, windows-latest]
1717

1818
runs-on: ${{ matrix.os }}
1919

2020
steps:
2121
- uses: actions/checkout@v4
2222

2323
- name: Configure CMake
24-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
24+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWARNINGS_AS_ERRORS=FALSE
2525

2626
- name: Build
2727
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

CMakePresets.json

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"generator": "Ninja",
1717
"binaryDir": "build/release",
1818
"cacheVariables": {
19-
"CMAKE_BUILD_TYPE": "Release"
19+
"CMAKE_BUILD_TYPE": "Release",
20+
"WARNINGS_AS_ERRORS": "FALSE"
2021
}
2122
},
2223
{
@@ -41,7 +42,8 @@
4142
"binaryDir": "build/xcode-release",
4243
"cacheVariables": {
4344
"CMAKE_BUILD_TYPE": "Release",
44-
"CMAKE_OSX_ARCHITECTURES": "x86_64;arm64"
45+
"CMAKE_OSX_ARCHITECTURES": "x86_64;arm64",
46+
"WARNINGS_AS_ERRORS": "FALSE"
4547
},
4648
"condition": {
4749
"type": "equals",
@@ -62,9 +64,7 @@
6264
"displayName": "Build Release",
6365
"configurePreset": "release",
6466
"configuration": "Release",
65-
"targets": [
66-
"App"
67-
]
67+
"targets": ["App"]
6868
},
6969
{
7070
"name": "xcode-debug",
@@ -82,9 +82,7 @@
8282
"displayName": "Build Release (Xcode)",
8383
"configurePreset": "xcode-release",
8484
"configuration": "Release",
85-
"targets": [
86-
"App"
87-
],
85+
"targets": ["App"],
8886
"condition": {
8987
"type": "equals",
9088
"lhs": "${hostSystemName}",
@@ -97,17 +95,13 @@
9795
"name": "release",
9896
"displayName": "Distribute Release",
9997
"configurePreset": "release",
100-
"configurations": [
101-
"Release"
102-
]
98+
"configurations": ["Release"]
10399
},
104100
{
105101
"name": "xcode-release",
106102
"displayName": "Distribute Release (Xcode)",
107103
"configurePreset": "xcode-release",
108-
"configurations": [
109-
"Release"
110-
],
104+
"configurations": ["Release"],
111105
"condition": {
112106
"type": "equals",
113107
"lhs": "${hostSystemName}",

cmake/CompilerWarnings.cmake

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

33
function(set_project_warnings project_name)
44
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" TRUE)
5-
message(STATUS "Treat compiler warnings as errors")
65

76
set(MSVC_WARNINGS
87
/W4 # Baseline reasonable warnings
@@ -59,6 +58,7 @@ function(set_project_warnings project_name)
5958
)
6059

6160
if (WARNINGS_AS_ERRORS)
61+
message(STATUS "Treat compiler warnings as errors")
6262
set(CLANG_WARNINGS ${CLANG_WARNINGS} -Werror)
6363
set(MSVC_WARNINGS ${MSVC_WARNINGS} /WX)
6464
endif ()

0 commit comments

Comments
 (0)