Files
agent_compositor_test/references/igraph-1.0.1/etc/cmake/lto.cmake
T
Abdelrahman Said a11edf0c53 Add graph references
2026-06-28 13:49:01 +01:00

24 lines
723 B
CMake

include(helpers)
tristate(IGRAPH_ENABLE_LTO "Enable link-time optimization" OFF)
include(CheckIPOSupported)
if(IGRAPH_ENABLE_LTO)
# this matches both ON and AUTO
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_NOT_SUPPORTED_REASON)
if(IGRAPH_ENABLE_LTO STREQUAL "AUTO")
# autodetection
set(IGRAPH_ENABLE_LTO ${IPO_SUPPORTED})
if(IPO_SUPPORTED)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
elseif(IPO_SUPPORTED)
# user wanted LTO and the compiler supports it
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
# user wanted LTO and the compiler does not support it
message(FATAL_ERROR "Link-time optimization not supported on this compiler")
endif()
endif()