Skip to content

Commit

Permalink
Permit to enable -Werror on builds, and enable by default for github …
Browse files Browse the repository at this point in the history
…actions. (#165)
  • Loading branch information
phkaeser authored Jan 16, 2025
1 parent 935552c commit 9d0f70b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-for-bookworm-wlroots-018.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
export PKG_CONFIG_PATH="${{ env.INSTALL_PKGCONFIG_PATH }}"
export LD_LIBRARY_PATH="${{ env.INSTALL_LIBRARY_PATH }}"
export PATH="${PATH}:${{ env.INSTALL_PATH }}/bin"
cmake -DCMAKE_INSTALL_PREFIX:PATH=${{ env.INSTALL_PATH }} -B build/
cmake -DCMAKE_INSTALL_PREFIX:PATH=${{ env.INSTALL_PATH }} -Dconfig_WERROR=ON -B build/
- name: Build wlmaker.
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-for-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Configure wlmaker through CMake.
run: |
export CC="${{ matrix.compiler }}"
cmake -B build/
cmake -B build/ -Dconfig_WERROR=ON
- name: Build wlmaker.
run: |
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
#
# Default arguments:
# cmake -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/.local -Dconfig_DOXYGEN_CRITICAL=ON -B build
# cmake -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/.local -Dconfig_DOXYGEN_CRITICAL=ON -Dconfig_WERROR=ON -B build
# CC=clang cmake -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/.local -Dconfig_DOXYGEN_CRITICAL=ON -B build-clang

CMAKE_MINIMUM_REQUIRED(VERSION 3.13)
Expand Down Expand Up @@ -69,10 +69,14 @@ ENDIF(NOT WLROOTS_FOUND)
OPTION(config_DEBUG "Include debugging information" ON)
OPTION(config_OPTIM "Optimizations" OFF)
OPTION(config_DOXYGEN_CRITICAL "Whether to fail on doxygen warnings" OFF)
OPTION(config_WERROR "Make all compiler warnings into errors." OFF)

# Toplevel compile options, for GCC and clang.
IF(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
ADD_COMPILE_OPTIONS(-Wall -Wextra)
IF(config_WERROR)
ADD_COMPILE_OPTIONS(-Werror)
ENDIF(config_WERROR)

IF(config_DEBUG)
ADD_COMPILE_OPTIONS(-ggdb -DDEBUG)
Expand Down
2 changes: 1 addition & 1 deletion submodules/libbase

0 comments on commit 9d0f70b

Please sign in to comment.