-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathconfigDeps.bat
177 lines (154 loc) · 4.7 KB
/
configDeps.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
::** (C) Copyright 2013, Applied Physical Sciences Corp., A General Dynamics Company
::**
::** Gravity is free software; you can redistribute it and/or modify
::** it under the terms of the GNU Lesser General Public License as published by
::** the Free Software Foundation; either version 3 of the License, or
::** (at your option) any later version.
::**
::** This program is distributed in the hope that it will be useful,
::** but WITHOUT ANY WARRANTY; without even the implied warranty of
::** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
::** GNU Lesser General Public License for more details.
::**
::** You should have received a copy of the GNU Lesser General Public
::** License along with this program;
::** If not, see <http://www.gnu.org/licenses/>.
::**
@echo off
setlocal
if not defined PROTOBUF_HOME (
echo You must define PROTOBUF_HOME
goto done
end
)
if not defined ZMQ_HOME (
echo You must define ZMQ_HOME
goto done
end
)
if not defined PTHREADS_HOME (
echo You must define PTHREADS_HOME
goto done
end
)
:menu
echo.
echo ===========================
echo ===== BUILD OPTIONS =======
echo.
echo 1 - VS2010 32-bit
echo 2 - VS2010 64-bit
echo 3 - VS2012 32-bit
echo 4 - VS2012 64-bit
echo 5 - VS2013 64-bit
echo Q - Quit
echo Build Selection:
choice /c:12345Q>nul
if errorlevel 6 goto done
if errorlevel 5 goto VS201364
if errorlevel 4 goto VS201264
if errorlevel 3 goto VS201232
if errorlevel 2 goto VS201064
if errorlevel 1 goto VS201032
echo NO SELECTION
goto done
:VS201032
echo ===== Configuring Gravity Dependencies for VS2010 32-bit =====
echo.
set PLATFORM=Win32
set PTHREAD_PLATFORM=x86
set PTHREAD_LIB=pthreadVCE2
set CONFIGURATION=Release2010
set DEBUG_CONFIGURATION=Debug2010
set VERSION=v100
goto config
:VS201064
echo ===== Configuring Gravity Dependencies for VS2010 64-bit =====
echo.
set PLATFORM=x64
set PTHREAD_PLATFORM=x64
set PTHREAD_LIB=pthreadVC2
set CONFIGURATION=Release2010
set DEBUG_CONFIGURATION=Debug2010
set VERSION=v100
goto config
:VS201232
echo ===== Configuring Gravity Dependencies for VS2012 32-bit =====
echo.
set PLATFORM=Win32
set PTHREAD_PLATFORM=x86
set PTHREAD_LIB=pthreadVCE2
set CONFIGURATION=Release2012
set DEBUG_CONFIGURATION=Debug2012
set VERSION=v110
goto config
:VS201264
echo ===== Configuring Gravity Dependencies for VS2012 64-bit =====
echo.
set PLATFORM=x64
set PTHREAD_PLATFORM=x64
set PTHREAD_LIB=pthreadVC2
set CONFIGURATION=Release2012
set DEBUG_CONFIGURATION=Debug2012
set VERSION=v110
goto config
:VS201364
echo ===== Configuring Gravity Dependencies for VS2013 64-bit =====
echo.
set PLATFORM=x64
set PTHREAD_PLATFORM=x64
set PTHREAD_LIB=pthreadVC2
set CONFIGURATION=Release2013
set DEBUG_CONFIGURATION=Debug2013
set VERSION=v120
goto config
:config
echo ===== Configuring Gravity Dependencies =====
echo.
set GRAVITY_DEPS=%PLATFORM%\%CONFIGURATION%\deps
rd /s /q %GRAVITY_DEPS%
md %GRAVITY_DEPS%
echo ===== Copying ZMQ libs =====
echo.
copy /y "%ZMQ_HOME%\lib\libzmq-%VERSION%-mt-3_2_3.lib" %GRAVITY_DEPS%
copy /y "%ZMQ_HOME%\lib\libzmq-%VERSION%-mt-gd-3_2_3.lib" %GRAVITY_DEPS%
copy /y "%ZMQ_HOME%\bin\libzmq-%VERSION%-mt-3_2_3.dll" %GRAVITY_DEPS%
copy /y "%ZMQ_HOME%\bin\libzmq-%VERSION%-mt-gd-3_2_3.dll" %GRAVITY_DEPS%
pushd %GRAVITY_DEPS%
fsutil hardlink create libzmq.lib libzmq-%VERSION%-mt-3_2_3.lib
fsutil hardlink create libzmq_d.lib libzmq-%VERSION%-mt-gd-3_2_3.lib
fsutil hardlink create libzmq.dll libzmq-%VERSION%-mt-3_2_3.dll
fsutil hardlink create libzmq_d.dll libzmq-%VERSION%-mt-gd-3_2_3.dll
popd
echo ===== Copying Protobuf libs =====
echo.
if %PLATFORM% EQU x64 (
copy /y %PROTOBUF_HOME%\vsprojects\x64\release\libprotobuf.lib %GRAVITY_DEPS%
copy /y %PROTOBUF_HOME%\vsprojects\x64\debug\libprotobuf_d.lib %GRAVITY_DEPS%
) else (
copy /y %PROTOBUF_HOME%\vsprojects\release\libprotobuf.lib %GRAVITY_DEPS%
copy /y %PROTOBUF_HOME%\vsprojects\debug\libprotobuf_d.lib %GRAVITY_DEPS%
)
echo ===== Copying PThreads libs =====
echo.
copy /y %PTHREADS_HOME%\lib\%PTHREAD_PLATFORM%\%PTHREAD_LIB%.lib %GRAVITY_DEPS%
copy /y %PTHREADS_HOME%\dll\%PTHREAD_PLATFORM%\%PTHREAD_LIB%.dll %GRAVITY_DEPS%
echo ===== Build Java Protobuf Runtime lib =====
echo.
pushd %PROTOBUF_HOME%\java
copy /y %PROTOBUF_HOME%\protoc.exe ..\src
protoc --java_out=src\main\java -I..\src ..\src\google\protobuf\descriptor.proto
pushd %PROTOBUF_HOME%\java\src\main\java
if not exist "build" mkdir build
javac -d .\build .\com\google\protobuf\*.java
jar cvf %PROTOBUF_HOME%\java\target\protobuf-java.jar -C build .
::call mvn package
popd
popd
copy /y /b %PROTOBUF_HOME%\java\target\protobuf-java-*.jar %GRAVITY_DEPS%\protobuf-java.jar
echo ===== Copy to Debug configuration =====
echo.
set DEBUG_DEPS=%PLATFORM%\%DEBUG_CONFIGURATION%\deps
md %DEBUG_DEPS%
xcopy %GRAVITY_DEPS% %DEBUG_DEPS% /S /Y
:done