50012bd88e
Change-Id: I5964d330f87949fd214873693204a153d22282a8 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529205 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
65 lines
1.5 KiB
Plaintext
65 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")
|
|
}
|
|
|
|
# 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 = "js"
|
|
output_name = "${_lib_name}"
|
|
}
|
|
|
|
group("$_lib_name") {
|
|
public_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" ]
|
|
}
|