aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorWilliam D. Jones <thor0505@comcast.net>2021-04-07 06:24:29 -0400
committerWilliam D. Jones <thor0505@comcast.net>2021-04-07 06:25:29 -0400
commit2cb2985539f066b972750e0c3a4fc1ded231368a (patch)
tree05180b1164ab05a15f22f175fab1e5c016e2bfc8 /CMakeLists.txt
parent31eda82b3f69e6d9dcc487d2aa8cab622df55cf7 (diff)
downloadnextpnr-2cb2985539f066b972750e0c3a4fc1ded231368a.tar.gz
nextpnr-2cb2985539f066b972750e0c3a4fc1ded231368a.tar.bz2
nextpnr-2cb2985539f066b972750e0c3a4fc1ded231368a.zip
Add CMake option to enable IPO (enabled by default).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
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)