function(target_enable_ipo)
    if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
        check_ipo_supported(RESULT ipo_supported)
        if(ipo_supported)
            set_property(TARGET ${ARGV} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
        else()
            message(WARNING "IPO is not supported by this compiler!")
        endif()
    endif()
endfunction()