Enable IPO only for Release build. (#1261)

This commit is contained in:
Fangjun Kuang
2024-08-15 18:16:42 +08:00
committed by GitHub
parent ca729faebf
commit 97a6a2a16a

View File

@@ -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':