astar/cmake/utile/lto.cmake

12 lines
292 B
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.9.0)
include(CheckIPOSupported)
check_ipo_supported(RESULT supported OUTPUT error)
if(supported)
message(STATUS "IPO / LTO enabled")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
else()
message(STATUS "IPO / LTO not supported: <${error}>")
endif()