From 8901c81aa046870212caa339094c31080d89f933 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 22 Jun 2024 12:03:54 +0200 Subject: [PATCH] Use LTO by default --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 532782067..ff598b10f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF) option(ENABLE_DEBUG_LOGGING "Use debug logging in release mode" OFF) option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF) option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF) -option(ENABLE_LTO "Use LTO if available" OFF) +option(ENABLE_LTO "Use LTO if available" ON) option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF) option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF) option(ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF) @@ -215,7 +215,7 @@ if(ENABLE_LTO AND (CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES message(STATUS "IPO / LTO enabled") set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) else() - message(WARNING "IPO / LTO not supported: <${error}>") + message(FATAL_ERROR "IPO / LTO not supported: <${error}>") endif() endif()