| 51 | |
| 52 | |
| 53 | def normalize_relative_python_path(): |
| 54 | # User may have specified the EMSDK_PYTHON environment variable to point to |
| 55 | # the Python interpreter, e.g. |
| 56 | # |
| 57 | # EMSDK_PYTHON=../../path/to/python emcc test/hello_world.c |
| 58 | # |
| 59 | # As part of its operation, emcc may spawn sub-emcc tasks when building |
| 60 | # libraries to cache. These sub-emcc tasks will run in a different CWD, so |
| 61 | # reinitialize EMSDK_PYTHON here so that sub-tool spawns will use the same |
| 62 | # Python interpreter as the parent. |
| 63 | if os.environ.get('EMSDK_PYTHON'): |
| 64 | os.environ['EMSDK_PYTHON'] = sys.executable |
| 65 | |
| 66 | |
| 67 | def set_config_from_tool_location(config_key, tool_binary, f): |