diff options
author | gatecat <gatecat@ds0.me> | 2021-04-07 12:21:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-07 12:21:23 +0100 |
commit | 883ece60346f2e077c193a47211a16e7e2b798b7 (patch) | |
tree | 05180b1164ab05a15f22f175fab1e5c016e2bfc8 | |
parent | 31eda82b3f69e6d9dcc487d2aa8cab622df55cf7 (diff) | |
parent | 2cb2985539f066b972750e0c3a4fc1ded231368a (diff) | |
download | nextpnr-883ece60346f2e077c193a47211a16e7e2b798b7.tar.gz nextpnr-883ece60346f2e077c193a47211a16e7e2b798b7.tar.bz2 nextpnr-883ece60346f2e077c193a47211a16e7e2b798b7.zip |
Merge pull request #665 from cr1901/optional-lto
Add CMake option to enable IPO (enabled by default).
-rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ff26d4ba..538ad1a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) |