diff --git a/.github/workflows/ci_build.yml b/.github/workflows/ci_build.yml index f2559c0..9a94269 100644 --- a/.github/workflows/ci_build.yml +++ b/.github/workflows/ci_build.yml @@ -54,7 +54,7 @@ jobs: sudo apt-get install -y vulkan-headers libvulkan-dev xorg-dev - name: CMake Configure - run: cmake -Bbuild -DVK_BOOTSTRAP_TEST=ON -DCMAKE_BUILD_TYPE=Debug + run: cmake -Bbuild -DVK_BOOTSTRAP_WERROR=ON -DVK_BOOTSTRAP_TEST=ON -DCMAKE_BUILD_TYPE=Debug - name: CMake Build run: cmake --build build @@ -79,7 +79,7 @@ jobs: echo "VULKAN_SDK=./Vulkan-Headers" >> $GITHUB_ENV - name: CMake Configure - run: cmake -Bbuild -DVK_BOOTSTRAP_TEST=ON -DCMAKE_BUILD_TYPE=Debug + run: cmake -Bbuild -DVK_BOOTSTRAP_WERROR=ON -DVK_BOOTSTRAP_TEST=ON -DCMAKE_BUILD_TYPE=Debug - name: CMake Build run: cmake --build build diff --git a/CMakeLists.txt b/CMakeLists.txt index 8766779..ab1d8ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR) project(VulkanBootstrap) +option(VK_BOOTSTRAP_WERROR "Enable warnings as errors during compilation" OFF) + add_library(vk-boostrap-vulkan-headers INTERFACE) set(VK_BOOTSTRAP_VULKAN_HEADER_DIR "" CACHE STRING "Specify the location of the Vulkan-Headers include directory.") @@ -43,14 +45,22 @@ target_compile_options(vk-bootstrap-compiler-warnings $<$,$,${VK_BOOTSTRAP_COMPILER_CLANGPP}>: -Wall -Wextra - -pedantic-errors -Wconversion -Wsign-conversion> $<$: - /WX /W4> ) +if(VK_BOOTSTRAP_WERROR) + target_compile_options(vk-bootstrap-compiler-warnings + INTERFACE + $<$,$,${VK_BOOTSTRAP_COMPILER_CLANGPP}>: + -pedantic-errors> + $<$: + /WX> + ) +endif() + target_include_directories(vk-bootstrap PUBLIC $ $)