Switch branches/tags
Nothing to show
Find file
480bd46 Mar 14, 2012
87 lines (70 sloc) 2.4 KB
@echo off
cd %~dp0
if /i "%1"=="help" goto help
if /i "%1"=="--help" goto help
if /i "%1"=="-help" goto help
if /i "%1"=="/help" goto help
if /i "%1"=="?" goto help
if /i "%1"=="-?" goto help
if /i "%1"=="--?" goto help
if /i "%1"=="/?" goto help
@rem Process arguments.
set config=Debug
set target=Build
set target_arch=ia32
set noprojgen=
set nobuild=
if "%1"=="" goto args-done
if /i "%1"=="debug" set config=Debug&goto arg-ok
if /i "%1"=="release" set config=Release&goto arg-ok
if /i "%1"=="clean" set target=Clean&goto arg-ok
if /i "%1"=="ia32" set target_arch=ia32&goto arg-ok
if /i "%1"=="x86" set target_arch=ia32&goto arg-ok
if /i "%1"=="x64" set target_arch=x64&goto arg-ok
if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
echo Warning: ignoring invalid command line option `%1`.
goto next-arg
@rem Skip project generation if requested.
if defined noprojgen goto msbuild
@rem Generate project files.
call tools\gyp\gyp.bat -Icommon.gypi luvmonkey.gyp -f msvs -G msvs_version=2010 --depth=. -Dtarget_arch=%target_arch% -Dlibrary=static_library
if errorlevel 1 goto create-msvs-files-failed
if not exist luvmonkey.sln goto create-msvs-files-failed
echo Project files generated.
@rem Skip build if requested.
if defined nobuild goto run
@rem Bail out early if not running in VS build env.
if defined VCINSTALLDIR goto msbuild-found
if not defined VS100COMNTOOLS goto msbuild-not-found
if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto msbuild-not-found
call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat"
if not defined VCINSTALLDIR goto msbuild-not-found
goto msbuild-found
echo Build skipped. To build, this file needs to run from VS cmd prompt.
goto run
@rem Build the sln with msbuild.
msbuild luvmonkey.sln /m /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit
@rem Nothing to run yet
goto exit
echo Failed to create vc project files.
goto exit
echo vcbuild.bat [debug/release] [clean] [noprojgen] [nobuild]
echo Examples:
echo vcbuild.bat : Build debug build.
echo vcbuild.bat nobuild: Generate visual studio project, don't build.
echo vcbuild.bat release: Build release build.
goto exit