-
Notifications
You must be signed in to change notification settings - Fork 623
CI/Build - Enable -Werror on GCC/Clang #1209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
676137d
191261a
6cd906b
181f2cb
80bdb6e
4ae78d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -152,6 +152,7 @@ runs: | |||||||||||||||||||||||||||||
| cmake -G "Unix Makefiles" \ | ||||||||||||||||||||||||||||||
| -D CMAKE_C_COMPILER=${{ inputs.compiler == 'clang' && 'clang' || 'gcc' }} \ | ||||||||||||||||||||||||||||||
| -D CMAKE_CXX_COMPILER=${{ inputs.compiler == 'clang' && 'clang++' || 'g++' }} \ | ||||||||||||||||||||||||||||||
| -D CMAKE_CXX_FLAGS="-Werror -Wzero-as-null-pointer-constant -Wno-unknown-warning-option -Wno-error=array-bounds -Wno-error=maybe-uninitialized -Wno-error=stringop-overflow -Wno-deprecated-declarations -Wno-error=cast-function-type-mismatch" \ | ||||||||||||||||||||||||||||||
| -D BUILD_USE_PCH=${{ inputs.build-use-pch }} \ | ||||||||||||||||||||||||||||||
|
Comment on lines
152
to
156
|
||||||||||||||||||||||||||||||
| -D BUILD_OPT_PROFILE=${{ inputs.build-opt-profile }} \ | ||||||||||||||||||||||||||||||
| -D BUILD_INCLUDE_SYMLINK=ON \ | ||||||||||||||||||||||||||||||
|
|
@@ -167,7 +168,6 @@ runs: | |||||||||||||||||||||||||||||
| -D BUILD_GTEST=ON \ | ||||||||||||||||||||||||||||||
| -D BUILD_CPP_STANDARD=C++17 \ | ||||||||||||||||||||||||||||||
| -D INSTALL_GTEST=ON \ | ||||||||||||||||||||||||||||||
| -D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wno-deprecated-declarations -Wno-unknown-warning-option -Wno-error=cast-function-type-mismatch" \ | ||||||||||||||||||||||||||||||
| ${{ inputs.additional-cmake-flags }} .. | ||||||||||||||||||||||||||||||
| echo "Configuration completed successfully for macOS" | ||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||
|
|
@@ -183,6 +183,7 @@ runs: | |||||||||||||||||||||||||||||
| cmake -G "Unix Makefiles" \ | ||||||||||||||||||||||||||||||
| -D CMAKE_C_COMPILER=${{ inputs.compiler == 'clang' && 'clang' || 'gcc' }} \ | ||||||||||||||||||||||||||||||
| -D CMAKE_CXX_COMPILER=${{ inputs.compiler == 'clang' && 'clang++' || 'g++' }} \ | ||||||||||||||||||||||||||||||
| -D CMAKE_CXX_FLAGS="-Werror -Wzero-as-null-pointer-constant -Wno-unknown-warning-option -Wno-error=array-bounds -Wno-error=maybe-uninitialized -Wno-error=stringop-overflow" \ | ||||||||||||||||||||||||||||||
|
Comment on lines
183
to
+186
|
||||||||||||||||||||||||||||||
| cmake -G "Unix Makefiles" \ | |
| -D CMAKE_C_COMPILER=${{ inputs.compiler == 'clang' && 'clang' || 'gcc' }} \ | |
| -D CMAKE_CXX_COMPILER=${{ inputs.compiler == 'clang' && 'clang++' || 'g++' }} \ | |
| -D CMAKE_CXX_FLAGS="-Werror -Wzero-as-null-pointer-constant -Wno-unknown-warning-option -Wno-error=array-bounds -Wno-error=maybe-uninitialized -Wno-error=stringop-overflow" \ | |
| CMAKE_CXX_FLAGS="-Werror -Wzero-as-null-pointer-constant" | |
| if [ "${{ inputs.compiler }}" = "clang" ]; then | |
| CMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS -Wno-unknown-warning-option" | |
| else | |
| CMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS -Wno-error=array-bounds -Wno-error=maybe-uninitialized -Wno-error=stringop-overflow" | |
| fi | |
| cmake -G "Unix Makefiles" \ | |
| -D CMAKE_C_COMPILER=${{ inputs.compiler == 'clang' && 'clang' || 'gcc' }} \ | |
| -D CMAKE_CXX_COMPILER=${{ inputs.compiler == 'clang' && 'clang++' || 'g++' }} \ | |
| -D CMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMAKE_CXX_FLAGShere includes-Wno-unknown-warning-option, which is Clang-specific. Since this action supportsinputs.compiler: gcc, invoking it with GCC would fail on an unknown option (and-Werrormay make this worse). Consider making the warning-flag list conditional on the selected compiler (or moving compiler-specific flags into CMake logic that checksCMAKE_CXX_COMPILER_ID).