@@ -11,13 +11,11 @@ if /i "%1"=="-?" goto help
11
11
if /i " %1 " == " --?" goto help
12
12
if /i " %1 " == " /?" goto help
13
13
14
- @ rem Bail out early if not running in VS build env.
15
- if not defined VCINSTALLDIR goto msbuild-not-found
16
-
17
14
@ rem Process arguments.
18
- set config = Debug
15
+ set config =
19
16
set target = Build
20
17
set noprojgen =
18
+ set nobuild =
21
19
set run =
22
20
23
21
:next-arg
@@ -28,22 +26,46 @@ if /i "%1"=="test" set run=run-tests.exe&goto arg-ok
28
26
if /i " %1 " == " bench" set run = run-benchmarks.exe& goto arg-ok
29
27
if /i " %1 " == " clean" set target = Clean& goto arg-ok
30
28
if /i " %1 " == " noprojgen" set noprojgen = 1& goto arg-ok
29
+ if /i " %1 " == " nobuild" set nobuild = 1& goto arg-ok
31
30
:arg-ok
32
31
shift
33
32
goto next-arg
34
33
:args-done
35
34
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
36
39
40
+ :project-gen
37
41
@ rem Skip project generation if requested.
38
42
if defined noprojgen goto msbuild
39
43
40
- :project-gen
41
44
@ 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 %~dp0 build\gyp.
55
+ goto exit
56
+
57
+ :have_gyp
58
+ python gyp_uv
43
59
if errorlevel 1 goto create-msvs-files-failed
44
60
if not exist uv.sln goto create-msvs-files-failed
61
+ echo Project files generated.
45
62
46
63
: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
+
47
69
@ rem Build the sln with msbuild.
48
70
msbuild uv.sln /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
49
71
if errorlevel 1 goto exit
@@ -52,21 +74,16 @@ if errorlevel 1 goto exit
52
74
@ rem Run tests if requested.
53
75
if " %run% " == " " goto exit
54
76
if not exist %config% \%run% goto exit
77
+ echo running '%config% \%run% '
55
78
%config% \%run%
56
79
goto exit
57
80
58
81
:create-msvs-files-failed
59
82
echo Failed to create vc project files.
60
83
goto exit
61
84
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
-
67
85
: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]
70
87
echo Examples:
71
88
echo vcbuild.bat : builds debug build
72
89
echo vcbuild.bat test : builds debug build and runs tests
0 commit comments