Merge pull request #40 from mhenschel/mhenschel-relocatable-1
Make .emscripten config file relocatable when using the --embedded flag
This commit is contained in:
7
emsdk
7
emsdk
@@ -724,6 +724,7 @@ def generate_dot_emscripten(active_tools):
|
|||||||
if emscripten_config_directory == emsdk_path():
|
if emscripten_config_directory == emsdk_path():
|
||||||
temp_dir = sdk_path('tmp')
|
temp_dir = sdk_path('tmp')
|
||||||
mkdir_p(temp_dir)
|
mkdir_p(temp_dir)
|
||||||
|
embedded=True
|
||||||
else:
|
else:
|
||||||
temp_dir = tempfile.gettempdir().replace('\\', '/')
|
temp_dir = tempfile.gettempdir().replace('\\', '/')
|
||||||
|
|
||||||
@@ -731,6 +732,9 @@ def generate_dot_emscripten(active_tools):
|
|||||||
has_node = False
|
has_node = False
|
||||||
|
|
||||||
cfg = 'import os\n'
|
cfg = 'import os\n'
|
||||||
|
|
||||||
|
if embedded:
|
||||||
|
cfg += 'emsdk_path=os.path.dirname(EM_CONFIG)\n'
|
||||||
|
|
||||||
for tool in active_tools:
|
for tool in active_tools:
|
||||||
tool_cfg = tool.activated_config()
|
tool_cfg = tool.activated_config()
|
||||||
@@ -754,6 +758,9 @@ COMPILER_ENGINE = NODE_JS
|
|||||||
JS_ENGINES = [NODE_JS]
|
JS_ENGINES = [NODE_JS]
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
if embedded:
|
||||||
|
cfg = cfg.replace(emscripten_config_directory, '\' + emsdk_path + \'')
|
||||||
|
|
||||||
with open(dot_emscripten_path(), "w") as text_file: text_file.write(cfg)
|
with open(dot_emscripten_path(), "w") as text_file: text_file.write(cfg)
|
||||||
|
|
||||||
# Clear old cached emscripten content.
|
# Clear old cached emscripten content.
|
||||||
|
|||||||
Reference in New Issue
Block a user