Add CMake option to enable IPO (enabled by default).

This commit is contained in:
William D. Jones 2021-04-07 06:24:29 -04:00
parent 31eda82b3f
commit 2cb2985539

View File

@ -19,8 +19,19 @@ option(STATIC_BUILD "Create static build" OFF)
option(EXTERNAL_CHIPDB "Create build with pre-built chipdb binaries" OFF)
option(WERROR "pass -Werror to compiler (used for CI)" OFF)
option(PROFILER "Link against libprofiler" OFF)
if(ipo_supported)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
option(USE_IPO "Compile nextpnr with IPO" ON)
if (USE_IPO)
if (ipo_supported)
message(STATUS "Building with IPO")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(STATUS "IPO is not supported with this compiler")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
endif()
else()
message(STATUS "Building without IPO")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
endif()
if(WIN32 OR EXTERNAL_CHIPDB)