aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)