[cmake] make unreachable code a warning when Bullet is enabled
When DEV_MODE=TRUE and we are compiling with Bullet using clang, some
unreachable code is found in the Bullet headers which causes the build
to fail.
@@ -50,7 +50,12 @@ endif()
if(DEV_MODE)
# --- Clang ----
#add_cxx_options("-Weverything" Clang) # like Wall and more
+ if (WITH_BULLET)
+ # some unreachable code errors come from the Bullet headers
+ add_cxx_options("-Wunreachable-code" "Clang")
+ else()
add_cxx_options("-Werror=unreachable-code" "Clang")
+ endif()
# --- All compilers but MSVC (Microsoft Visual C) ---
if(NOT MSVC)
add_cxx_options("-Wall")
