From 3b3190671f9699eddbc4e14e6798d23164b40fe8 Mon Sep 17 00:00:00 2001 From: Johannes Schneider Date: Thu, 3 Apr 2025 16:37:08 +0200 Subject: [PATCH] Enable all gcc and clang warnings for testing the CI --- CMakeLists.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f31eea..abb17df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,34 @@ if (CMAKE_VERSION VERSION_LESS "3.21") string(COMPARE EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} PROJECT_IS_TOP_LEVEL) endif() +# Set warning flags for gcc and clang +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} + -Wall + -Wextra + -Wpedantic + -Wconversion + -Wsign-conversion + -Wshadow + -Wnull-dereference + -Wdouble-promotion + -Wformat=2 + -Wimplicit-fallthrough + -Wundef + -Wcast-align + -Woverloaded-virtual + -Wnon-virtual-dtor + -Wstrict-overflow=5 + -Wuseless-cast + -Wduplicated-cond + -Wduplicated-branches + -Wlogical-op + -Wredundant-decls + -Wstrict-null-sentinel + -Wold-style-cast") + message(STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS}) +endif() + option(VMA_ENABLE_INSTALL "Install VulkanMemoryAllocator" ${PROJECT_IS_TOP_LEVEL}) if (VMA_ENABLE_INSTALL) include(GNUInstallDirs)