From ed07924b0a4750f03e223b139fdfe09696e1b81b Mon Sep 17 00:00:00 2001 From: Eric Mertens Date: Fri, 18 Nov 2022 23:33:30 -0800 Subject: [PATCH] Disable IPO when debugging --- CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16016d0..ad2f2f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,12 +6,14 @@ project(aocpp LANGUAGES C CXX ) -include(CheckIPOSupported) -check_ipo_supported(RESULT result OUTPUT output) -if(result) - set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) -else() - message(WARNING "IPO is not supported: ${output}") +if(NOT CMAKE_BUILD_TYPE MATCHES "^Debug$") + include(CheckIPOSupported) + check_ipo_supported(RESULT result OUTPUT output) + if(result) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + else() + message(WARNING "IPO is not supported: ${output}") + endif() endif() find_package(PkgConfig)