1
0
mirror of https://github.com/YosysHQ/nextpnr.git synced 2026-02-11 10:44:58 +00:00

Merge pull request #665 from cr1901/optional-lto

Add CMake option to enable IPO (enabled by default).
This commit is contained in:
gatecat
2021-04-07 12:21:23 +01:00
committed by GitHub

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)