fe13e83056
Change-Id: I7ea4428787c69b4045a234403d8ca33c2aff2b7d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511876 Reviewed-by: Kevin Lubick <kjlubick@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
66 lines
1.5 KiB
Plaintext
66 lines
1.5 KiB
Plaintext
# Copyright (c) 2022 The Chromium 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("../../modules/canvaskit/canvaskit.gni")
|
|
|
|
# Defines the configuration of emscripten for building WASM targets.
|
|
import("../skia.gni")
|
|
declare_args() {
|
|
# The location of an activated emsdk. We default to the one brought in by
|
|
# DEPS and bin/activate-emsdk.
|
|
skia_emsdk_dir = rebase_path("../../third_party/externals/emsdk")
|
|
}
|
|
|
|
is_wasm = target_os == "wasm"
|
|
|
|
# Defines a WASM library target.
|
|
template("skia_wasm_lib") {
|
|
_vars_to_forward = [
|
|
"cflags",
|
|
"ldflags",
|
|
"defines",
|
|
"deps",
|
|
"includes",
|
|
"sources",
|
|
"include_dirs",
|
|
"public_configs",
|
|
"testonly",
|
|
"visibility",
|
|
]
|
|
|
|
_lib_name = target_name
|
|
|
|
executable("${_lib_name}.js") {
|
|
forward_variables_from(invoker, _vars_to_forward)
|
|
output_extension = ""
|
|
}
|
|
|
|
group("$_lib_name") {
|
|
deps = [ ":${_lib_name}.js" ]
|
|
}
|
|
}
|
|
|
|
wasm_defines = [
|
|
"SKNX_NO_SIMD",
|
|
"SK_DISABLE_AAA",
|
|
"SK_FORCE_8_BYTE_ALIGNMENT",
|
|
]
|
|
|
|
if (!is_debug && !skia_canvaskit_force_tracing) {
|
|
wasm_defines += [ "SK_DISABLE_TRACING" ]
|
|
}
|
|
|
|
if (skia_enable_gpu) {
|
|
wasm_defines += [ "SK_DISABLE_LEGACY_SHADERCONTEXT" ]
|
|
}
|
|
|
|
if (!skia_canvaskit_enable_effects_deserialization ||
|
|
!skia_canvaskit_enable_skp_serialization) {
|
|
wasm_defines += [ "SK_DISABLE_EFFECT_DESERIALIZATION" ]
|
|
}
|
|
|
|
if (!skia_canvaskit_enable_alias_font) {
|
|
wasm_defines += [ "CANVASKIT_NO_ALIAS_FONT" ]
|
|
}
|