Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Disable LTO in builds of CanvasKit to reduce binary size #40733

Merged
merged 1 commit into from
Mar 29, 2023
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
6 changes: 6 additions & 0 deletions third_party/canvaskit/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ wasm_toolchain("canvaskit") {
skia_use_libjpeg_turbo_decode = true
skia_use_libpng_decode = true
skia_use_libwebp_decode = true

# Disable LTO.
enable_lto = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is going to be the same for all CanvasKit builds, you can also add it to tools/gn. But this is good too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding it to tools/gn would conflict with skwasm, which must always be built with LTO enabled

}
}

Expand All @@ -40,6 +43,9 @@ wasm_toolchain("canvaskit_chromium") {
skia_use_libjpeg_turbo_decode = true
skia_use_libpng_decode = true
skia_use_libwebp_decode = true

# Disable LTO.
enable_lto = false
}
}

Expand Down