Set warnings as errors for the generator, the samples, and the tests.

This commit is contained in:
asuessenbach
2020-09-30 12:00:32 +02:00
parent 5ecb57bdc5
commit 8d1c84b3f5
43 changed files with 644 additions and 309 deletions

View File

@@ -24,6 +24,12 @@ if (NOT (TESTS_BUILD_ONLY_DYNAMIC AND TESTS_BUILD_WITH_LOCAL_VULKAN_HPP))
find_package(Vulkan REQUIRED)
endif()
if(MSVC)
add_compile_options(/W4 /WX /permissive-)
else(MSVC)
add_compile_options(-Wall -Wextra -pedantic -Werror)
endif(MSVC)
if (WIN32)
add_definitions(-DNOMINMAX -DVK_USE_PLATFORM_WIN32_KHR)
elseif(UNIX)

View File

@@ -15,6 +15,15 @@
// VulkanHpp Samples : DeviceFunctions
// Compile test on device functions
// ignore warning 4189: local variable is initialized but not referenced
#if defined( _MSC_VER )
# pragma warning( disable : 4189 )
#elif defined( __GNUC__ )
# pragma GCC diagnostic ignored "-Wunused-variable"
#else
// unknow compiler... just ignore the warnings for yourselves ;)
#endif
#include "vulkan/vulkan.hpp"
#include <iostream>

View File

@@ -15,6 +15,15 @@
// VulkanHpp Tests : StructureChain
// Compile-test for StructureChains
// ignore warning 4189: local variable is initialized but not referenced
#if defined( _MSC_VER )
# pragma warning( disable : 4189 )
#elif defined( __GNUC__ )
# pragma GCC diagnostic ignored "-Wunused-variable"
#else
// unknow compiler... just ignore the warnings for yourselves ;)
#endif
#define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
#include "vulkan/vulkan.hpp"
@@ -24,14 +33,6 @@
static char const * AppName = "StructureChain";
static char const * EngineName = "Vulkan.hpp";
#if defined( _MSC_VER )
# pragma warning( disable : 4189 )
#elif defined( __GNUC__ )
# pragma GCC diagnostic ignored "-Wunused-variable"
#else
// unknow compiler... just ignore the warnings for yourselves ;)
#endif
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
template <typename T>