fix build (win): Update build scripts to use VS 2022 & py venv
Clean scripts up a bit while we're at it
This commit is contained in:
1 parent
80a5ec5265
commit
45d6d0f673
4 files changed
+56
-23
No files matched your search
+12
-5
@@ -1,8 +1,15 @@
|
||||
@REM This script can be run the regular cmd prompt
|
||||
@echo off
|
||||
setlocal
|
||||
@call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat" > nul
|
||||
cd /d %~dp0/../
|
||||
setlocal
|
||||
set path=%spark_build_python_path%;%path%
|
||||
touch src\lib\CMakeLists.txt
|
||||
set tools_dir=%~dp0
|
||||
set repo_dir=%tools_dir%\..
|
||||
set build_dir=%repo_dir%\build
|
||||
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" > nul
|
||||
|
||||
if not exist %build_dir% (
|
||||
call "%tools_dir%\setup_builds.bat"
|
||||
)
|
||||
|
||||
touch %repo_dir%\src\lib\CMakeLists.txt
|
||||
msbuild /m /nologo /p:debugtype=portable /p:platform=x64 /p:GenerateFullPaths=true /clp:verbosity=minimal /clp:summary %* spark_client.sln
|
||||
@@ -0,0 +1,25 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set venv_dir=%~dp0..\.venv
|
||||
|
||||
if exist %venv_dir% (
|
||||
if "%1"=="--force" (
|
||||
echo Removing python virtual environment
|
||||
rmdir /S /Q %venv_dir%
|
||||
) else (
|
||||
GOTO ERROR
|
||||
)
|
||||
)
|
||||
|
||||
echo Creating python virtual environment
|
||||
@call python -m venv %venv_dir%
|
||||
@call %venv_dir%\Scripts\activate.bat
|
||||
@call pip install --upgrade pip
|
||||
@call %venv_dir%\Scripts\pip install -r %~dp0..\requirements.txt
|
||||
@call deactivate
|
||||
|
||||
EXIT /B %ERRORLEVEL%
|
||||
|
||||
:ERROR
|
||||
EXIT /B 1
|
||||
@@ -1,7 +1,6 @@
|
||||
@REM This script should be run from the VS dev prompt
|
||||
@echo off
|
||||
setlocal
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat" > nul
|
||||
cd /d %~dp0/../
|
||||
msbuild /m /p:platform=x64 /clp:verbosity=minimal /clp:summary /t:restore /p:RestoreSources=externals\windows\nuget\packages spark_client.sln
|
||||
msbuild /m /p:platform=x64 /clp:verbosity=minimal /clp:summary /p:Configuration=release /t:restore /p:RestoreSources=externals\windows\nuget\packages spark_client.sln
|
||||
msbuild /m /p:platform=x64 /clp:verbosity=minimal /clp:summary /t:restore spark_client.sln
|
||||
msbuild /m /p:platform=x64 /clp:verbosity=minimal /clp:summary /p:Configuration=release /t:restore spark_client.sln
|
||||
|
||||
+16
-14
@@ -1,15 +1,17 @@
|
||||
@REM This script should be run from the VS dev prompt
|
||||
@echo off
|
||||
@setlocal
|
||||
cd /d %~dp0\..
|
||||
mkdir build 2> nul
|
||||
cd build
|
||||
rmdir /s /q Debug
|
||||
rmdir /s /q Release
|
||||
if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" (
|
||||
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -G "Visual Studio 15 2017 Win64" ..
|
||||
) else (
|
||||
cmake.exe -G "Visual Studio 15 2017 Win64" ..
|
||||
)
|
||||
copy /y ..\tools\cpp.build.props Directory.Build.Props
|
||||
del spark.sln
|
||||
%~dp0\nuget_restore.cmd
|
||||
setlocal
|
||||
set tools_dir=%~dp0
|
||||
set repo_dir=%tools_dir%\..
|
||||
set build_dir=%repo_dir%\build
|
||||
mkdir %build_dir% 2> nul
|
||||
if exist %build_dir%\Debug (
|
||||
rmdir /s /q %build_dir%\Debug
|
||||
)
|
||||
if exist %build_dir%\Release (
|
||||
rmdir /s /q %build_dir%\Release
|
||||
)
|
||||
cmake.exe -G "Visual Studio 17 2022" -B %build_dir% -S %repo_dir%
|
||||
copy /y %tools_dir%\cpp.build.props %build_dir%\Directory.Build.Props
|
||||
del %build_dir%\spark.sln
|
||||
%tools_dir%\nuget_restore.cmd
|
||||
Reference in new issue
Block a user