From 648e35caff35e5fe8ebec65ced070f37f326bf20 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 16 Oct 2024 11:22:32 +1000 Subject: [PATCH] optimisation: allow RTTI under Windows This makes using some libraries slightly easier / possible (eg, fmtlib) --- nc_optimisation.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ()