blob: 362a75a1a7b845873662ae53ee630f3faa9bb66f [file] [log] [blame]
# Copyright 2019 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/toolchain/wasm.gni")
wasm_lib("skwasm") {
sources = [
"canvas.cpp",
"contour_measure.cpp",
"data.cpp",
"export.h",
"fonts.cpp",
"helpers.h",
"paint.cpp",
"path.cpp",
"picture.cpp",
"shaders.cpp",
"string.cpp",
"surface.cpp",
"text/line_metrics.cpp",
"text/paragraph.cpp",
"text/paragraph_builder.cpp",
"text/paragraph_style.cpp",
"text/strut_style.cpp",
"text/text_style.cpp",
"wrappers.h",
]
ldflags = [
"-std=c++20",
"-lGL",
"-sUSE_WEBGL2=1",
"-sMAX_WEBGL_VERSION=2",
"-sOFFSCREENCANVAS_SUPPORT",
"-sPTHREAD_POOL_SIZE=1",
"-sALLOW_MEMORY_GROWTH",
"-sALLOW_TABLE_GROWTH",
"-sUSE_PTHREADS=1",
"-lexports.js",
"-sEXPORTED_FUNCTIONS=[stackAlloc]",
"-sEXPORTED_RUNTIME_METHODS=[addFunction,removeFunction]",
"-Wno-pthreads-mem-growth",
]
if (is_debug) {
ldflags += [
"-sDEMANGLE_SUPPORT=1",
"-sASSERTIONS=1",
"-sGL_ASSERTIONS=1",
]
} else {
ldflags += [
"-Oz",
"--closure=1",
]
}
deps = [
"//third_party/skia",
"//third_party/skia/modules/skparagraph",
]
}