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.
This commit is contained in:
Nadia Holmquist Pedersen 2024-06-18 15:51:08 +02:00
parent e234385c20
commit cbb0f4b872
1 changed files with 3 additions and 1 deletions

View File

@ -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 "$<$<COMPILE_LANGUAGE:CXX>:-Wno-invalid-offsetof>")
# These warnings are excessive, and are only triggered in the ARMJIT code