From d5021e7ed5aa3f30e25125e2569a6a94bbe502c4 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Thu, 18 Mar 2021 14:01:40 -0700 Subject: [PATCH] Add IPO support for nextpnr, and have it enabled by default. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index daddb258..704815e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,11 @@ project(nextpnr CXX C) # Allow family.cmake add additional dependencies to gui_${family}. cmake_policy(SET CMP0079 NEW) +# Enable IPO support. +cmake_policy(SET CMP0069 NEW) +include(CheckIPOSupported) +check_ipo_supported() + option(BUILD_GUI "Build GUI" OFF) option(BUILD_PYTHON "Build Python Integration" ON) option(BUILD_TESTS "Build tests" OFF) @@ -14,6 +19,8 @@ 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) +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + if(WIN32 OR EXTERNAL_CHIPDB) set(BBASM_MODE "binary") else()