Enable LTO

This commit is contained in:
Yulong Wang 2025-01-16 01:38:11 -08:00
parent c3cab12fd6
commit df3562e874

View file

@ -29,8 +29,8 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
# (2) "-flto=thin" does not work correctly for wasm-ld.
# we don't set onnxruntime_ENABLE_LTO because it appends flag "-flto=thin"
# instead, we manually set CMAKE_CXX_FLAGS "-flto"
#string(APPEND CMAKE_C_FLAGS " -flto")
#string(APPEND CMAKE_CXX_FLAGS " -flto")
string(APPEND CMAKE_C_FLAGS " -flto")
string(APPEND CMAKE_CXX_FLAGS " -flto")
endif()
if (onnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO)