From aa293440e08e481f40fcf19b0e4ce0f317a77fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 16 Mar 2019 15:43:52 +0100 Subject: [PATCH] modules: updated FindCorrade.cmake. --- modules/FindCorrade.cmake | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index f6bc09c17..52562bf30 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -282,6 +282,9 @@ endif() # Read flags from configuration file(READ ${_CORRADE_CONFIGURE_FILE} _corradeConfigure) set(_corradeFlags + # WARNING: CAREFUL HERE, the string(FIND) succeeds even if a subset is + # found -- so e.g. looking for TARGET_GL will match TARGET_GLES2 as well. + # So far that's not a problem, but might become an issue for new flags. MSVC2015_COMPATIBILITY MSVC2017_COMPATIBILITY BUILD_DEPRECATED @@ -406,10 +409,23 @@ foreach(_component ${Corrade_FIND_COMPONENTS}) endif() # No special setup for Containers library - # No special setup for Interconnect library + + # Interconnect library + if(_component STREQUAL Interconnect) + # Disable /OPT:ICF on MSVC, which merges functions with identical + # contents and thus breaks signal comparison + if(CORRADE_TARGET_WINDOWS AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(CMAKE_VERSION VERSION_LESS 3.13) + set_property(TARGET Corrade::${_component} PROPERTY + INTERFACE_LINK_LIBRARIES "-OPT:NOICF,REF") + else() + set_property(TARGET Corrade::${_component} PROPERTY + INTERFACE_LINK_OPTIONS "/OPT:NOICF,REF") + endif() + endif() # PluginManager library - if(_component STREQUAL PluginManager) + elseif(_component STREQUAL PluginManager) # At least static build needs this if(CORRADE_TARGET_UNIX) set_property(TARGET Corrade::${_component} APPEND PROPERTY