optimisation: allow RTTI under Windows

This makes using some libraries slightly easier / possible (eg, fmtlib)
This commit is contained in:
Danny Robson 2024-10-16 11:22:32 +10:00
parent 9bcb80eca6
commit 648e35caff

View File

@ -214,7 +214,10 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
endif()
else ()
append_compile_flag(-O2)
# Some dependencies (eg, fmtlib) unconditionally use `dynamic_cast` so need RTTI enabled.
if (NOT WIN32)
append_compile_flag(-fno-rtti)
endif ()
add_definitions(-DNO_RTTI)
add_definitions(-DNDEBUG)
endif ()