From 77009b08ca9a11327287b8de717d96b9273b8fa6 Mon Sep 17 00:00:00 2001 From: Diomendius <42310725+Diomendius@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:04:51 +1200 Subject: [PATCH] Avoid Clang c++11-narrowing error Downgrades c++11-narrowing to a warning when compiling with Clang. A better solution would be to fix the error, but this at least brings Clang in line with the more permissive GCC, which treats this as a warning by default. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef25998..10b62ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,12 @@ SET(EXECNAME "AerofoilX" CACHE STRING "Defines the exec name") message(${CMAKE_BINARY_DIR}) +# FIXME: Clang treats this as an error by default; fixing the source rather +# than downgrading the error to a warning would be a better solution. +add_compile_options( + $<$:-Wno-error=c++11-narrowing> + ) + find_package(SDL2 REQUIRED) if(PLATFORM STREQUAL "MAC")