In my project I have the following code to enable link time optimization on non-debug builds.
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED)
if(IPO_SUPPORTED AND (NOT CMAKE_BUILD_TYPE MATCHES Debug))
set_target_properties(nvim PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
I wanted to rewrite this so that it worked for multi-config generators as well. But as I understand it generator expressions doesn’t work with target properties. How can I write this so that it supports both single and multi config generators?