Enable all gcc and clang warnings for testing the CI

This commit is contained in:
Johannes Schneider 2025-04-03 16:37:08 +02:00
parent 0183545f02
commit 3b3190671f
No known key found for this signature in database

View file

@ -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)