From cbb0f4b872ea8a5e2348c7f1a22695056968192f Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Tue, 18 Jun 2024 15:51:08 +0200 Subject: [PATCH] Tell the compiler that we want wrapping signed arithmetic The core relies on this and without -fwrapv there will be rendering issues on some targets. Thanks CasualPokePlayer for noticing this. --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5b7806c..3e177835 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -141,7 +141,9 @@ target_link_libraries(core PRIVATE teakra) if (NOT MSVC) # MSVC has its own compiler flag syntax; if we ever support it, - # be sure to silence any equivalent warnings there. + # be sure to add equivalent flags here. + + target_compile_options(core PUBLIC -fwrapv) target_compile_options(core PRIVATE "$<$:-Wno-invalid-offsetof>") # These warnings are excessive, and are only triggered in the ARMJIT code