22setlocal
33rem Simple script to fetch source for external libraries
44
5- if " % PCBUILD% " == " " (set PCBUILD=%~dp0 )
6- if " % EXTERNALS_DIR% " == " " (set EXTERNALS_DIR=%PCBUILD% \..\externals)
5+ if NOT DEFINED PCBUILD (set PCBUILD=%~dp0 )
6+ if NOT DEFINED EXTERNALS_DIR (set EXTERNALS_DIR=%PCBUILD% \..\externals)
77
88set DO_FETCH = true
99set DO_CLEAN = false
@@ -34,7 +34,7 @@ call "%PCBUILD%\find_python.bat" "%PYTHON%"
3434
3535git 2 >& 1 > nul
3636if ERRORLEVEL 9009 (
37- if " % PYTHON% " == " " (
37+ if NOT DEFINED PYTHON (
3838 echo Python 3.6 could not be found or installed, and git.exe is not on your PATH && exit /B 1
3939 )
4040)
@@ -56,7 +56,7 @@ if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tix-8.4.3.5
5656for %%e in (%libraries% ) do (
5757 if exist " %EXTERNALS_DIR% \%%e " (
5858 echo .%%e already exists, skipping.
59- ) else if " % PYTHON% " == " " (
59+ ) else if NOT DEFINED PYTHON (
6060 echo .Fetching %%e with git...
6161 git clone --depth 1 https://github.com/%ORG% /cpython-source-deps --branch %%e " %EXTERNALS_DIR% \%%e "
6262 ) else (
@@ -74,7 +74,7 @@ if NOT "%IncludeSSL%"=="false" set binaries=%binaries% nasm-2.11.06
7474for %%b in (%binaries% ) do (
7575 if exist " %EXTERNALS_DIR% \%%b " (
7676 echo .%%b already exists, skipping.
77- ) else if " % PYTHON% " == " " (
77+ ) else if NOT DEFINED PYTHON (
7878 echo .Fetching %%b with git...
7979 git clone --depth 1 https://github.com/%ORG% /cpython-bin-deps --branch %%b " %EXTERNALS_DIR% \%%b "
8080 ) else (
0 commit comments