Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ def generate_config(path, first_time=False):
# 4. Fall back users home directory (~/.emscripten).

embedded_config = path_from_root('.emscripten')
# For compatibility with emsdk --embedded mode also look two levels up. This
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe mention why two levels up? That is, that when using the emsdk, the structure would look like

emsdk/
  emscripten/

But that picture must be wrong since you say two levels and not one..?

# could be removed if emsdk was to use the emscripten directory itself for the
# embedded config: https://github.com/emscripten-core/emsdk/pull/367
emsdk_root = os.path.dirname(os.path.dirname(__rootpath__))
emsdk_embedded_config = os.path.join(emsdk_root, '.emscripten')

if '--em-config' in sys.argv:
EM_CONFIG = sys.argv[sys.argv.index('--em-config') + 1]
# And now remove it from sys.argv
Expand All @@ -289,6 +295,8 @@ def generate_config(path, first_time=False):
EM_CONFIG = os.environ['EM_CONFIG']
elif os.path.exists(embedded_config):
EM_CONFIG = embedded_config
elif os.path.exists(emsdk_embedded_config):
EM_CONFIG = emsdk_embedded_config
else:
EM_CONFIG = '~/.emscripten'

Expand Down