-
Notifications
You must be signed in to change notification settings - Fork 7
/
build_windows_64.bat
77 lines (63 loc) · 1.8 KB
/
build_windows_64.bat
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@ECHO OFF
ECHO ------------------------------------
ECHO Cleaning workspace
ECHO ------------------------------------
DEL /Q *.dll
RMDIR /S /Q _build
ECHO ------------------------------------
ECHO Extracting Git Revision Number
ECHO ------------------------------------
SET SEMANTIC=0.0.1
SET /p SEMANTIC=<symantic.version
IF NOT DEFINED GIT_HOME (
git --version
IF "%ERRORLEVEL%" == "0" (
SET GIT_HOME=git
) ELSE (
ECHO "Could not find git."
PAUSE
EXIT /B 1
)
)
FOR /f "delims=" %%A in ('%GIT_HOME% rev-list HEAD --count') do SET "GIT_REV_COUNT=%%A"
FOR /f "delims=" %%A in ('%GIT_HOME% rev-parse HEAD') do SET "GIT_REV=%%A"
SET VERSION=%SEMANTIC%.%GIT_REV_COUNT%
ECHO Version: %VERSION%
ECHO # THIS IS A GENERATED FILE > version.properties
ECHO version='%VERSION%' >> version.properties
ECHO revision='%GIT_REV%' >> version.properties
ECHO #define PEACHY_USB_VERSION "%VERSION%" > inc/version.h
ECHO Git Revision Number is %GIT_REV_COUNT%
ECHO ------------------------------------
ECHO Creating DLL
ECHO ------------------------------------
mkdir win64
IF NOT "%ERRORLEVEL%" == "0" (
ECHO FAILED executing command: mkdir win64
EXIT /B 100
)
mkdir _build
IF NOT "%ERRORLEVEL%" == "0" (
ECHO FAILED executing command: mkdir _build
EXIT /B 101
)
cd _build
cmake .. -G "Visual Studio 12 2013 Win64"
IF NOT "%ERRORLEVEL%" == "0" (
ECHO FAILED executing command: cmake .. -G "Visual Studio 12 2013 Win64"
EXIT /B 102
)
cmake --build . --config Release
IF NOT "%ERRORLEVEL%" == "0" (
ECHO FAILED executing command: cmake --build . --config Release
EXIT /B 103
)
ECHO ------------------------------------
ECHO Moving file
ECHO ------------------------------------
copy src\Release\libPeachyUSB.dll ..\win64
IF NOT "%ERRORLEVEL%" == "0" (
ECHO "FAILED moving files"
EXIT /B 798
)
cd ..