comparison third_party/emsdk/emsdk.bat @ 186:8cf4ec5e2191 hg-web

Fixed merge conflict.
author MrJuneJune <me@mrjunejune.com>
date Fri, 23 Jan 2026 22:38:59 -0800
parents 8d17f6e6e290
children
comparison
equal deleted inserted replaced
176:fed99fc04e12 186:8cf4ec5e2191
1 @echo off
2
3 :: Find python from an explicit location relative to the Emscripten SDK.
4
5 setlocal
6
7 :: When using our bundled python we never want the users
8 :: PYTHONHOME or PYTHONPATH
9 :: https://github.com/emscripten-core/emsdk/issues/598
10
11 if exist "%~dp0python\3.13.3_64bit\python.exe" (
12 set EMSDK_PY="%~dp0python\3.13.3_64bit\python.exe"
13 set PYTHONHOME=
14 set PYTHONPATH=
15 goto end
16 )
17
18 if exist "%~dp0python\3.9.2_64bit\python.exe" (
19 set EMSDK_PY="%~dp0python\3.9.2_64bit\python.exe"
20 set PYTHONHOME=
21 set PYTHONPATH=
22 goto end
23 )
24
25 if exist "%~dp0python\3.9.2-nuget_64bit\python.exe" (
26 set EMSDK_PY="%~dp0python\3.9.2-nuget_64bit\python.exe"
27 set PYTHONHOME=
28 set PYTHONPATH=
29 goto end
30 )
31
32 :: As a last resort, access from PATH.
33 set EMSDK_PY=python
34
35 :end
36 call %EMSDK_PY% "%~dp0\emsdk.py" %*
37
38 :: If emsdk returned with error code >= 1, then skip executing emsdk_set_env
39 :: below.
40 if ERRORLEVEL 1 (
41 endlocal
42 exit /b %ERRORLEVEL%
43 )
44
45 endlocal
46
47 :: python is not able to set environment variables to the parent calling
48 :: process, so therefore have it craft a .bat file, which we invoke after
49 :: finishing python execution, to set up the environment variables
50 if exist "%~dp0\emsdk_set_env.bat" (
51 call "%~dp0\emsdk_set_env.bat" > nul
52 del /F /Q "%~dp0\emsdk_set_env.bat"
53 )