From: Vladislav Shchapov Date: Mon, 4 Apr 2022 08:37:12 +0000 (+0500) Subject: Disable LTO in CMake X-Git-Tag: 2.1.0-beta1~272 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c467068a3055669db53c0c8a205e573d61286d3f;p=thirdparty%2Fzlib-ng.git Disable LTO in CMake --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c8d8679..f049a0c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,6 +249,14 @@ else() endif() endif() +# Disable LTO +if(NOT WITH_NATIVE_INSTRUCTIONS) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF) + foreach(_cfg_name IN LISTS CMAKE_CONFIGURATION_TYPES) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_${_cfg_name} OFF) + endforeach() +endif() + # Set architecture alignment requirements if(NOT WITH_UNALIGNED) add_definitions(-DNO_UNALIGNED)