I am having a lib which contains "-fno-rtti" in INTERFACE_COMPILE_OPTIONS. on the executable side, I want to remove the "-fno-rtti" in compile option. is there any way to remove or disable the "-fno-rtti" option of the executable target without changing the cmake source code of lib?
I tried to remove the option on the lib side like below, but I want to know any better way to avoid the option on the executable side, without damaging the lib target.
get_target_property(target_options MyLib INTERFACE_COMPILE_OPTIONS)
list(REMOVE_ITEM target_options "-fno-rtti")
set_property(TARGET MyLib PROPERTY INTERFACE_COMPILE_OPTIONS ${target_options})