forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 2
/
activate_emsdk.py
42 lines (33 loc) · 1004 Bytes
/
activate_emsdk.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/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.abspath(
os.path.join(__file__, '..', '..', '..', 'buildtools', 'emsdk')
)
EMSDK_PATH = os.path.join(EMSDK_ROOT, 'emsdk.py')
# See lib/web_ui/README.md for instructions on updating the EMSDK version.
EMSDK_VERSION = '3.1.32'
def main():
try:
subprocess.check_call([
sys.executable, EMSDK_PATH, 'install', EMSDK_VERSION
],
stdout=subprocess.DEVNULL)
except subprocess.CalledProcessError:
print('Failed to install emsdk')
return 1
try:
subprocess.check_call([
sys.executable, EMSDK_PATH, 'activate', EMSDK_VERSION
],
stdout=subprocess.DEVNULL)
except subprocess.CalledProcessError:
print('Failed to activate emsdk')
return 1
if __name__ == '__main__':
sys.exit(main())