This commit is contained in:
Joel Winarske 2024-05-27 12:51:49 +08:00 committed by GitHub
commit b35215ef69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -367,3 +367,16 @@ if (GLFW_INSTALL)
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif() endif()
#--------------------------------------------------------------------
# Link Time Optimization
#--------------------------------------------------------------------
if (BUILD_SHARED_LIBS AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.9.0")
include(CheckIPOSupported)
check_ipo_supported(RESULT result OUTPUT output)
if(result)
message(STATUS "glfw: Using IPO")
set_property(TARGET glfw PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING "IPO is not supported: ${output}")
endif ()
endif ()