Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/emscons.py
6170 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
15
from tools import building, utils
16
17
tool_path = utils.path_from_root('tools/scons/site_scons/site_tools/emscripten')
18
building_env = building.get_building_env()
19
20
env = os.environ.copy()
21
env['EMSCRIPTEN_TOOL_PATH'] = tool_path
22
env['EMSCRIPTEN_ROOT'] = utils.path_from_root()
23
env['EMSCONS_PKG_CONFIG_LIBDIR'] = building_env['PKG_CONFIG_LIBDIR']
24
env['EMSCONS_PKG_CONFIG_PATH'] = building_env['PKG_CONFIG_PATH']
25
26
sys.exit(subprocess.call(sys.argv[1:], env=env))
27
28