-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.cmd
52 lines (45 loc) · 1.54 KB
/
build.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@echo off
setlocal enabledelayedexpansion
:: Untested: ProgramFiles(x86) is not set for 32-bit programs pre Windows 10
if not defined ProgramFiles(x86) set ProgramFiles(x86)=%ProgramFiles%
set branch=%1
shift
:: Prefer the older build tools for v1
if [%branch%]==[master] goto :try_comntools
:try_vswhere
:: Is VS 2019 or (untested)2017 installed?
set vswhere="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist %vswhere% exit /b
for /f "usebackq delims=" %%i in (`%vswhere% -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath`) do (
if exist "%%i\Common7\Tools\vsdevcmd.bat" (
call "%%i\Common7\Tools\vsdevcmd.bat"
goto :building
)
)
:try_comntools
if defined VS100COMNTOOLS set VSCOMNTOOLS=%VS100COMNTOOLS%
if defined VS110COMNTOOLS set VSCOMNTOOLS=%VS110COMNTOOLS%
if defined VS120COMNTOOLS set VSCOMNTOOLS=%VS120COMNTOOLS%
if defined VS140COMNTOOLS set VSCOMNTOOLS=%VS140COMNTOOLS%
if not defined VSCOMNTOOLS (
if not defined vswhere goto :try_vswhere
echo ---- BUILD TOOLS NOT FOUND ----
exit /b 1
)
call "%VSCOMNTOOLS%..\..\VC\vcvarsall.bat"
:building
set config=%1
set platform=%2
if [%platform%]==[] exit /b 0
if "%AUTOHOTKEY_BUILD_TARGET%"=="" set AUTOHOTKEY_BUILD_TARGET=Rebuild
echo ++++ Building %config% :: %platform% ++++
MSBuild AutoHotkeyx.sln /t:%AUTOHOTKEY_BUILD_TARGET% /p:Configuration=%config% /p:Platform=%platform%
if ErrorLevel 1 (
echo ---- BUILD FAILED: !config! :: !platform! ----
exit /b %ErrorLevel%
)
echo.
echo.
shift
shift
goto :building