diff --git a/nc_optimisation.cmake b/nc_optimisation.cmake index aecd8ba..a1dad10 100644 --- a/nc_optimisation.cmake +++ b/nc_optimisation.cmake @@ -214,7 +214,10 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) endif() else () append_compile_flag(-O2) - append_compile_flag(-fno-rtti) + # 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 ()