skia2/bin/activate-emsdk
Kevin Lubick c13cd6479d Reland "Build CanvasKit using GN/Ninja"
This is a reland of ecac712bec

Changes (best viewed comparing PS1 to latest)
 - Use emsdk 3.1.3 which includes important bug fixes
 - Remove unnecessary steps in compile.sh
 - Fix use of various gn args.
 - Avoid conflicts with Flutter's GN symbols
 - Add/update docs
 - Make activate-emsdk script compatible with our infra.

Original change's description:
> Build CanvasKit using GN/Ninja
>
> Build with
>
> ./bin/gn gen out/wasm_debug '--args=target_cpu="wasm"'
>
> or
>
> ./bin/gn gen out/wasm_release '--args=target_cpu="wasm" is_debug=false'
>
> Change-Id: Ib74586bf8397d57064a3899eaa6da76f9bce9049
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502036
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I601712a8953c2799fa029e782e097905b95e6b59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507717
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-02-15 16:31:10 +00:00

32 lines
789 B
Python
Executable File

#!/usr/bin/env python
# Copyright 2022 Google LLC
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
EMSDK_ROOT = os.path.join('third_party', 'externals', 'emsdk')
EMSDK_PATH = os.path.join(EMSDK_ROOT, 'emsdk.py')
EMSDK_VERSION = '3.1.3'
def main():
try:
subprocess.check_call([sys.executable, EMSDK_PATH, 'install', EMSDK_VERSION])
except subprocess.CalledProcessError:
print ('Failed to install emsdk')
return 1
try:
subprocess.check_call([sys.executable, EMSDK_PATH, 'activate', EMSDK_VERSION])
except subprocess.CalledProcessError:
print ('Failed to activate emsdk')
return 1
if __name__ == '__main__':
sys.exit(main())