aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-03-19 09:39:34 +0000
committergatecat <gatecat@ds0.me>2021-03-19 09:40:27 +0000
commitbac2a8ba0249c8c574a15024dc7b3d716cc9fe56 (patch)
tree5b6ec60f67d27a494d41808b705c53d481ffbb86 /CMakeLists.txt
parentaa8b12db6f0cb7859207a26de268315225270c94 (diff)
downloadnextpnr-bac2a8ba0249c8c574a15024dc7b3d716cc9fe56.tar.gz
nextpnr-bac2a8ba0249c8c574a15024dc7b3d716cc9fe56.tar.bz2
nextpnr-bac2a8ba0249c8c574a15024dc7b3d716cc9fe56.zip
cmake: Use IPO only if supported
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3c4472c..7159efd4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@ cmake_policy(SET CMP0079 NEW)
# Enable IPO support.
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)
-check_ipo_supported()
+check_ipo_supported(RESULT ipo_supported)
option(BUILD_GUI "Build GUI" OFF)
option(BUILD_PYTHON "Build Python Integration" ON)
@@ -19,8 +19,9 @@ 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)
-
-set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+if(ipo_supported)
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+endif()
if(WIN32 OR EXTERNAL_CHIPDB)
set(BBASM_MODE "binary")