Compare commits

...

2 Commits

Author SHA1 Message Date
Joel Winarske
f5789965dd
Merge 89d101550d into 228e58262e 2024-04-12 21:02:10 +08:00
Joel Winarske
89d101550d IPO support
- When BUILD_SHARED_LIBS=ON and CMake version >= 3.9 use IPO

Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
2022-10-01 09:37:17 -07:00

View File

@ -366,3 +366,16 @@ if (GLFW_INSTALL)
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
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 ()