merge create_msvs_files.bat and vcbuild.bat into vcbuild.bat
This commit is contained in:
parent
39aac4a5fc
commit
e954b4cd99
@ -1,21 +0,0 @@
|
|||||||
@echo off
|
|
||||||
|
|
||||||
cd %~dp0
|
|
||||||
|
|
||||||
if exist build\gyp goto have_gyp
|
|
||||||
|
|
||||||
echo svn co http://gyp.googlecode.com/svn/trunk@983 build/gyp
|
|
||||||
svn co http://gyp.googlecode.com/svn/trunk@983 build/gyp
|
|
||||||
if errorlevel 1 goto gyp_install_failed
|
|
||||||
goto have_gyp
|
|
||||||
|
|
||||||
:gyp_install_failed
|
|
||||||
echo Failed to download gyp. Make sure you have subversion installed, or
|
|
||||||
echo manually install gyp into %~dp0build\gyp.
|
|
||||||
goto exit
|
|
||||||
|
|
||||||
:have_gyp
|
|
||||||
python gyp_uv
|
|
||||||
if not errorlevel 1 echo Done.
|
|
||||||
|
|
||||||
:exit
|
|
||||||
43
vcbuild.bat
43
vcbuild.bat
@ -11,13 +11,11 @@ if /i "%1"=="-?" goto help
|
|||||||
if /i "%1"=="--?" goto help
|
if /i "%1"=="--?" goto help
|
||||||
if /i "%1"=="/?" goto help
|
if /i "%1"=="/?" goto help
|
||||||
|
|
||||||
@rem Bail out early if not running in VS build env.
|
|
||||||
if not defined VCINSTALLDIR goto msbuild-not-found
|
|
||||||
|
|
||||||
@rem Process arguments.
|
@rem Process arguments.
|
||||||
set config=Debug
|
set config=
|
||||||
set target=Build
|
set target=Build
|
||||||
set noprojgen=
|
set noprojgen=
|
||||||
|
set nobuild=
|
||||||
set run=
|
set run=
|
||||||
|
|
||||||
:next-arg
|
:next-arg
|
||||||
@ -28,22 +26,46 @@ if /i "%1"=="test" set run=run-tests.exe&goto arg-ok
|
|||||||
if /i "%1"=="bench" set run=run-benchmarks.exe&goto arg-ok
|
if /i "%1"=="bench" set run=run-benchmarks.exe&goto arg-ok
|
||||||
if /i "%1"=="clean" set target=Clean&goto arg-ok
|
if /i "%1"=="clean" set target=Clean&goto arg-ok
|
||||||
if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
|
if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
|
||||||
|
if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
|
||||||
:arg-ok
|
:arg-ok
|
||||||
shift
|
shift
|
||||||
goto next-arg
|
goto next-arg
|
||||||
:args-done
|
:args-done
|
||||||
|
|
||||||
|
if not "%config%"=="" goto project-gen
|
||||||
|
if "%run%"=="run-tests.exe" set config=Debug& goto project-gen
|
||||||
|
if "%run%"=="run-benchmarks.exe" set config=Release& goto project-gen
|
||||||
|
set config=Debug
|
||||||
|
|
||||||
|
:project-gen
|
||||||
@rem Skip project generation if requested.
|
@rem Skip project generation if requested.
|
||||||
if defined noprojgen goto msbuild
|
if defined noprojgen goto msbuild
|
||||||
|
|
||||||
:project-gen
|
|
||||||
@rem Generate the VS project.
|
@rem Generate the VS project.
|
||||||
call create-msvs-files.bat
|
|
||||||
|
if exist build\gyp goto have_gyp
|
||||||
|
echo svn co http://gyp.googlecode.com/svn/trunk@983 build/gyp
|
||||||
|
svn co http://gyp.googlecode.com/svn/trunk@983 build/gyp
|
||||||
|
if errorlevel 1 goto gyp_install_failed
|
||||||
|
goto have_gyp
|
||||||
|
|
||||||
|
:gyp_install_failed
|
||||||
|
echo Failed to download gyp. Make sure you have subversion installed, or
|
||||||
|
echo manually install gyp into %~dp0build\gyp.
|
||||||
|
goto exit
|
||||||
|
|
||||||
|
:have_gyp
|
||||||
|
python gyp_uv
|
||||||
if errorlevel 1 goto create-msvs-files-failed
|
if errorlevel 1 goto create-msvs-files-failed
|
||||||
if not exist uv.sln goto create-msvs-files-failed
|
if not exist uv.sln goto create-msvs-files-failed
|
||||||
|
echo Project files generated.
|
||||||
|
|
||||||
:msbuild
|
:msbuild
|
||||||
|
@rem Skip project generation if requested.
|
||||||
|
if defined nobuild goto run
|
||||||
|
|
||||||
|
if not defined VCINSTALLDIR echo Build skipped. To build, this file needs to run from VS cmd prompt.& goto run
|
||||||
|
|
||||||
@rem Build the sln with msbuild.
|
@rem Build the sln with msbuild.
|
||||||
msbuild uv.sln /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
|
msbuild uv.sln /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
|
||||||
if errorlevel 1 goto exit
|
if errorlevel 1 goto exit
|
||||||
@ -52,6 +74,7 @@ if errorlevel 1 goto exit
|
|||||||
@rem Run tests if requested.
|
@rem Run tests if requested.
|
||||||
if "%run%"=="" goto exit
|
if "%run%"=="" goto exit
|
||||||
if not exist %config%\%run% goto exit
|
if not exist %config%\%run% goto exit
|
||||||
|
echo running '%config%\%run%'
|
||||||
%config%\%run%
|
%config%\%run%
|
||||||
goto exit
|
goto exit
|
||||||
|
|
||||||
@ -59,14 +82,8 @@ goto exit
|
|||||||
echo Failed to create vc project files.
|
echo Failed to create vc project files.
|
||||||
goto exit
|
goto exit
|
||||||
|
|
||||||
:msbuild-not-found
|
|
||||||
echo Failed to build. In order to build the solution this file needs
|
|
||||||
echo to run from VS command script.
|
|
||||||
goto exit
|
|
||||||
|
|
||||||
:help
|
:help
|
||||||
echo This script must run from VS command prompt.
|
echo vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen] [nobuild]
|
||||||
echo vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen]
|
|
||||||
echo Examples:
|
echo Examples:
|
||||||
echo vcbuild.bat : builds debug build
|
echo vcbuild.bat : builds debug build
|
||||||
echo vcbuild.bat test : builds debug build and runs tests
|
echo vcbuild.bat test : builds debug build and runs tests
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user