Skip to content

Commit

Permalink
Tell the compiler that we want wrapping signed arithmetic
Browse files Browse the repository at this point in the history
The core relies on this and without -fwrapv there will be rendering
issues on some targets. Thanks CasualPokePlayer for noticing this.
  • Loading branch information
nadiaholmquist committed Jun 18, 2024
1 parent e234385 commit cbb0f4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cbb0f4b

Please sign in to comment.