Flutter Engine
The Flutter Engine
activate_emsdk.py
Go to the documentation of this file.
1#!/usr/bin/env python
2
3# Copyright 2022 Google LLC
4#
5# Use of this source code is governed by a BSD-style license that can be
6# found in the LICENSE file.
7
8import os
9import subprocess
10import sys
11
12EMSDK_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', 'prebuilts', 'emsdk'))
13
14EMSDK_PATH = os.path.join(EMSDK_ROOT, 'emsdk.py')
15
16# See lib/web_ui/README.md for instructions on updating the EMSDK version.
17EMSDK_VERSION = '3.1.44'
18
19
20def main():
21 try:
22 subprocess.check_call([sys.executable, EMSDK_PATH, 'install', EMSDK_VERSION],
23 stdout=subprocess.DEVNULL)
24 except subprocess.CalledProcessError:
25 print('Failed to install emsdk')
26 return 1
27 try:
28 subprocess.check_call([sys.executable, EMSDK_PATH, 'activate', EMSDK_VERSION],
29 stdout=subprocess.DEVNULL)
30 except subprocess.CalledProcessError:
31 print('Failed to activate emsdk')
32 return 1
33
34
35if __name__ == '__main__':
36 sys.exit(main())
Definition: main.py:1
def print(*args, **kwargs)
Definition: run_tests.py:49