summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Shchapov <vladislav@shchapov.ru>2022-04-04 13:37:12 +0500
committerHans Kristian Rosbach <hk-github@circlestorm.org>2023-03-17 21:27:56 +0100
commit3de0d2bd3bdcd0cbc00f571ca3341bb73c46c12b (patch)
tree28ab9c895aec7defc71ee394e967e1b6f4bb6285
parente24530ef2a8e741505a483168149109fbcd9cfda (diff)
Disable LTO in CMake
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 309e341..7196460 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -276,6 +276,14 @@ if(NOT MSVC AND NOT CMAKE_C_FLAGS MATCHES "([\\/\\-]O)3")
CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
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(WITH_UNALIGNED)
if((BASEARCH_ARM_FOUND AND NOT "${ARCH}" MATCHES "armv[2-7]") OR (BASEARCH_PPC_FOUND AND "${ARCH}" MATCHES "powerpc64le") OR BASEARCH_X86_FOUND)