27 lines
909 B
Batchfile
27 lines
909 B
Batchfile
@echo off
|
|
setlocal
|
|
|
|
call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\VsDevCmd.bat"
|
|
|
|
set TOOLS_DIR=%~dp0
|
|
set REPO_DIR=%~dp0..
|
|
set BUILD_SPARK_PY=%TOOLS_DIR%\py\build_spark.py
|
|
|
|
@REM Run 'touch' to force CMake to recompute CMakeDeps (otherwise,
|
|
@REM adding/removing source files will cause the build to fail).
|
|
@REM Hide error output in case 'touch' isn't in the PATH
|
|
@REM touch %REPO_DIR%\src\lib\CMakeLists.txt 2>nul
|
|
|
|
if DEFINED VIRTUAL_ENV (
|
|
@REM We're already in a venv, just run build_spark.py (whether or not it is
|
|
@REM the 'right' venv is the caller's responsibility)
|
|
echo "Building in the current venv '%VIRTUAL_ENV'"
|
|
@call python %BUILD_SPARK_PY% %*
|
|
) else (
|
|
@REM Ensure the (default) venv is created, then run build_spark.py in it
|
|
@call %TOOLS_DIR%\ensure_venv.cmd
|
|
@call %TOOLS_DIR%\venv_exec.cmd python %BUILD_SPARK_PY% %*
|
|
)
|
|
|
|
EXIT /B %ERRORLEVEL%
|