Skip to content

Commit e954b4c

Browse files
author
Igor Zinkovsky
committed
merge create_msvs_files.bat and vcbuild.bat into vcbuild.bat
1 parent 39aac4a commit e954b4c

File tree

2 files changed

+30
-34
lines changed

2 files changed

+30
-34
lines changed

create-msvs-files.bat

Lines changed: 0 additions & 21 deletions
This file was deleted.

vcbuild.bat

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ if /i "%1"=="-?" goto help
1111
if /i "%1"=="--?" goto help
1212
if /i "%1"=="/?" goto help
1313

14-
@rem Bail out early if not running in VS build env.
15-
if not defined VCINSTALLDIR goto msbuild-not-found
16-
1714
@rem Process arguments.
18-
set config=Debug
15+
set config=
1916
set target=Build
2017
set noprojgen=
18+
set nobuild=
2119
set run=
2220

2321
:next-arg
@@ -28,22 +26,46 @@ if /i "%1"=="test" set run=run-tests.exe&goto arg-ok
2826
if /i "%1"=="bench" set run=run-benchmarks.exe&goto arg-ok
2927
if /i "%1"=="clean" set target=Clean&goto arg-ok
3028
if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
29+
if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
3130
:arg-ok
3231
shift
3332
goto next-arg
3433
:args-done
3534

35+
if not "%config%"=="" goto project-gen
36+
if "%run%"=="run-tests.exe" set config=Debug& goto project-gen
37+
if "%run%"=="run-benchmarks.exe" set config=Release& goto project-gen
38+
set config=Debug
3639

40+
:project-gen
3741
@rem Skip project generation if requested.
3842
if defined noprojgen goto msbuild
3943

40-
:project-gen
4144
@rem Generate the VS project.
42-
call create-msvs-files.bat
45+
46+
if exist build\gyp goto have_gyp
47+
echo svn co http://gyp.googlecode.com/svn/trunk@983 build/gyp
48+
svn co http://gyp.googlecode.com/svn/trunk@983 build/gyp
49+
if errorlevel 1 goto gyp_install_failed
50+
goto have_gyp
51+
52+
:gyp_install_failed
53+
echo Failed to download gyp. Make sure you have subversion installed, or
54+
echo manually install gyp into %~dp0build\gyp.
55+
goto exit
56+
57+
:have_gyp
58+
python gyp_uv
4359
if errorlevel 1 goto create-msvs-files-failed
4460
if not exist uv.sln goto create-msvs-files-failed
61+
echo Project files generated.
4562

4663
:msbuild
64+
@rem Skip project generation if requested.
65+
if defined nobuild goto run
66+
67+
if not defined VCINSTALLDIR echo Build skipped. To build, this file needs to run from VS cmd prompt.& goto run
68+
4769
@rem Build the sln with msbuild.
4870
msbuild uv.sln /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
4971
if errorlevel 1 goto exit
@@ -52,21 +74,16 @@ if errorlevel 1 goto exit
5274
@rem Run tests if requested.
5375
if "%run%"=="" goto exit
5476
if not exist %config%\%run% goto exit
77+
echo running '%config%\%run%'
5578
%config%\%run%
5679
goto exit
5780

5881
:create-msvs-files-failed
5982
echo Failed to create vc project files.
6083
goto exit
6184

62-
:msbuild-not-found
63-
echo Failed to build. In order to build the solution this file needs
64-
echo to run from VS command script.
65-
goto exit
66-
6785
:help
68-
echo This script must run from VS command prompt.
69-
echo vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen]
86+
echo vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen] [nobuild]
7087
echo Examples:
7188
echo vcbuild.bat : builds debug build
7289
echo vcbuild.bat test : builds debug build and runs tests

0 commit comments

Comments
 (0)