From 97a6a2a16ad7b7a931ea6bf954d067b29f752769 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Thu, 15 Aug 2024 18:16:42 +0800 Subject: [PATCH] Enable IPO only for Release build. (#1261) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a443ece0d..37a6b3ac7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,7 +149,7 @@ if(BUILD_SHARED_LIBS) set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() -if(BUILD_SHARED_LIBS AND NOT CMAKE_SYSTEM_NAME STREQUAL iOS) +if(BUILD_SHARED_LIBS AND NOT CMAKE_SYSTEM_NAME STREQUAL iOS AND CMAKE_BUILD_TYPE STREQUAL Release) # Don't use LTO for iOS since it causes the following error # error: unable to find any architecture information in the binary # at '/Users/fangjun/open-source/sherpa-onnx/build-ios/build/os64/sherpa-onnx.a':