Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/emscons.py
4091 views
1
#!/usr/bin/env python3
2
"""Wrapping the scons invocation, EMSCRIPTEN_TOOL_PATH is set in the process
3
environment, and can be used to locate the emscripten SCons Tool.
4
5
Example:
6
7
# Load emscripten Tool
8
my_env = Environment(tools=['emscripten'], toolpath=[os.environ['EMSCRIPTEN_TOOL_PATH']])
9
"""
10
11
import os
12
import subprocess
13
import sys
14
from tools import building, utils
15
16
tool_path = utils.path_from_root('tools/scons/site_scons/site_tools/emscripten')
17
building_env = building.get_building_env()
18
19
env = os.environ.copy()
20
env['EMSCRIPTEN_TOOL_PATH'] = tool_path
21
env['EMSCRIPTEN_ROOT'] = utils.path_from_root()
22
env['EMSCONS_PKG_CONFIG_LIBDIR'] = building_env['PKG_CONFIG_LIBDIR']
23
env['EMSCONS_PKG_CONFIG_PATH'] = building_env['PKG_CONFIG_PATH']
24
25
sys.exit(subprocess.call(sys.argv[1:], env=env))
26
27