Skip to content

Commit

Permalink
Support spaces in python executable in .bat launcher scripts (emscrip…
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 authored Jul 23, 2020
1 parent 2033379 commit 0cddccb
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 92 deletions.
11 changes: 4 additions & 7 deletions em++.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions em-config.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions emar.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions embuilder.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions emcc.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions emcmake.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions emconfigure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions emmake.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions emranlib.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions emrun.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions emscons.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions emsize.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
11 changes: 4 additions & 7 deletions tools/run_python.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
:: To modify this file, edit `tools/run_python.bat` and then run
:: `tools/create_entry_points.py`

@IF "%PYTHON%"=="" (
@SET PYTHON=%EMSDK_PYTHON%
set EM_PY=%EMSDK_PYTHON%
if "%EM_PY%"=="" (
set EM_PY=python
)

@IF "%PYTHON%"=="" (
@SET PYTHON=python
)

%PYTHON% "%~dp0\%~n0.py" %*
"%EM_PY%" "%~dp0\%~n0.py" %*
2 changes: 1 addition & 1 deletion tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_cflags(force_object_files=False):
def run_one_command(cmd):
# Helper function used by run_build_commands.
if shared.EM_BUILD_VERBOSE:
print(' '.join(cmd))
print(shared.shlex_join(cmd))
# building system libraries and ports should be hermetic in that it is not
# affected by things like EMMAKEN_CFLAGS which the user may have set
safe_env = os.environ.copy()
Expand Down

0 comments on commit 0cddccb

Please sign in to comment.