forked from emscripten-core/emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup scons support and remove config file parsing (emscripten-core…
…#7249) This change is precursor to removing EMSCRIPTEN_ROOT from the emscripten config file. Now scons requires EMSCRIPTEN_ROOT to be set explicitly in the environment. The rational for this change is that having the EMSCRIPTEN_ROOT set in the config can leave is in a contradictory state. e.g. when emcc runs from location X but the config file says EMSCRIPTEN_ROOT is location Y. In most cases it is the tool entry point that dictates the root directory. The only exception was scons which was trying to imply the root based on the config. Also importantly this change removes the `exec` of the config file from scons which should allow is to be more strict in how we parse and evaluate the config file in `tools/shared.py` since it will hopefully soon be the only consumer.
- Loading branch information
Showing
7 changed files
with
70 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
#!/usr/bin/env python2 | ||
#!/usr/bin/env python | ||
|
||
''' | ||
Wrapping the scons invocation, EMSCRIPTEN_TOOL_PATH is set in the process | ||
environment, and can be used to locate the emscripten SCons Tool. | ||
Example: | ||
# Load emscripten Tool | ||
my_env = Environment(tools=['emscripten'], toolpath=[os.environ['EMSCRIPTEN_TOOL_PATH']]) | ||
''' | ||
# This script should work in python 2 *or* 3. It loads the main code using | ||
# python_selector, which may pick a different version. | ||
|
||
import os, subprocess, sys | ||
from tools import shared | ||
from tools import python_selector | ||
|
||
tool_path = os.path.join(shared.path_from_root('tools'), 'scons', 'site_scons', 'site_tools', 'emscripten') | ||
|
||
env = os.environ.copy() | ||
env[ 'EMSCRIPTEN_TOOL_PATH' ] = tool_path | ||
|
||
exit(subprocess.call(sys.argv[1:], env=env)) | ||
import sys | ||
|
||
if __name__ == '__main__': | ||
python_selector.run(__file__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python2 | ||
"""Wrapping the scons invocation, EMSCRIPTEN_TOOL_PATH is set in the process | ||
environment, and can be used to locate the emscripten SCons Tool. | ||
Example: | ||
# Load emscripten Tool | ||
my_env = Environment(tools=['emscripten'], toolpath=[os.environ['EMSCRIPTEN_TOOL_PATH']]) | ||
""" | ||
|
||
import os | ||
import subprocess | ||
import sys | ||
from tools import shared | ||
|
||
tool_path = os.path.join(shared.path_from_root('tools'), 'scons', 'site_scons', 'site_tools', 'emscripten') | ||
|
||
env = os.environ.copy() | ||
env['EMSCRIPTEN_TOOL_PATH'] = tool_path | ||
|
||
sys.exit(subprocess.call(sys.argv[1:], env=env)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
env = Environment() | ||
import os | ||
env = Environment(toolpath=[os.environ.get('EMSCRIPTEN_TOOL_PATH')]) | ||
env.Tool('emscripten') | ||
env.Append(CXXFLAGS='-std=c++11') | ||
env.Program('scons_integration', ['integration.cpp', 'other.c']) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters