Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tools/python/util/vcpkg_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ def add_port_configs(
)"""
)

# When building ONNX for WebAssembly, we disable doc strings to reduce the binary size. The ONNX doc strings are
# only used for error messages and are not critical for end users. Disabling them can significantly reduce the
# binary size, which is important for WebAssembly targets.
if is_emscripten:
f.write(
r"""
string(APPEND VCPKG_C_FLAGS " -D__ONNX_NO_DOC_STRINGS")
string(APPEND VCPKG_CXX_FLAGS " -D__ONNX_NO_DOC_STRINGS")"""
)

f.write(r"""
endif() # End ONNX-specific block
""")
Expand Down
Loading