Fangjun Kuang
Committed by GitHub

Enable IPO only for Release build. (#1261)

@@ -149,7 +149,7 @@ if(BUILD_SHARED_LIBS) @@ -149,7 +149,7 @@ if(BUILD_SHARED_LIBS)
149 set(CMAKE_POSITION_INDEPENDENT_CODE ON) 149 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
150 endif() 150 endif()
151 151
152 -if(BUILD_SHARED_LIBS AND NOT CMAKE_SYSTEM_NAME STREQUAL iOS) 152 +if(BUILD_SHARED_LIBS AND NOT CMAKE_SYSTEM_NAME STREQUAL iOS AND CMAKE_BUILD_TYPE STREQUAL Release)
153 # Don't use LTO for iOS since it causes the following error 153 # Don't use LTO for iOS since it causes the following error
154 # error: unable to find any architecture information in the binary 154 # error: unable to find any architecture information in the binary
155 # at '/Users/fangjun/open-source/sherpa-onnx/build-ios/build/os64/sherpa-onnx.a': 155 # at '/Users/fangjun/open-source/sherpa-onnx/build-ios/build/os64/sherpa-onnx.a':