-
Notifications
You must be signed in to change notification settings - Fork 0
/
all_build.bat
152 lines (116 loc) · 8.85 KB
/
all_build.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
@echo off
pushd "%~dp0"
echo -----Editing props-----
powershell -executionpolicy bypass -file edit_props.ps1
echo #### nuget packages install
mkdir grpc\vsprojects\packages & cd grpc\vsprojects\packages
powershell -executionpolicy bypass -Command Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile "%cd%\nuget.exe"
nuget.exe install ..\vcxproj\grpc\packages.config
cd ..\..\..\
echo ----Props editting done-----
@setlocal
@REM EDIT THIS SECTION ACCORDING TO YOUR ENV
if not defined DevEnvDir (
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
)
set path=%path%;C:\Program Files (x86)\CMake\bin
set path=%path%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
set path=%path%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
@REM EOF
echo -----Building grpc-----
set devenv=devenv
mkdir grpc\bin\zlib
mkdir grpc\bin\zlib\debug
mkdir grpc\bin\zlib\release
mkdir lib
cd grpc\third_party\zlib
mkdir build & cd build
mkdir debug & cd debug
cmake -Wno-error -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../../../bin/zlib/debug ../..
nmake & nmake install
cd ..
mkdir release & cd release
cmake -Wno-error -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../../../bin/zlib/release ../..
nmake & nmake install
cd ../../../../bin/zlib/release
set PATH=%PATH%;%cd%\bin
popd
pushd "%~dp0"
cd grpc\third_party\protobuf\cmake
mkdir build & cd build
mkdir solution & cd solution
cmake -Wno-error -G "Visual Studio 14 2015 Win64" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_WITH_ZLIB=ON ../..
"%devenv%" protobuf.sln /build "Debug|x64" /project ALL_BUILD
if not %ERRORLEVEL% == 0 goto Finish
robocopy /mir .\Debug ..\..\..\..\..\bin\protobuf\debug
"%devenv%" protobuf.sln /build "Release|x64" /project ALL_BUILD
if not %ERRORLEVEL% == 0 goto Finish
robocopy /mir .\Release ..\..\..\..\..\bin\protobuf\release
cd ..\..\..\..\..\vsprojects
"%devenv%" grpc_protoc_plugins.sln /build "Release|x64"
if not %ERRORLEVEL% == 0 goto Finish
robocopy .\x64\Release\ ..\bin\grpc_protoc_plugins\ /XF *.lib *.iobj *.ipdb
"%devenv%" grpc_protoc_plugins.sln /clean "Release|x64"
"%devenv%" grpc.sln /clean "Debug"
"%devenv%" grpc.sln /clean "Release"
"%devenv%" grpc.sln /build "Debug|x64" /project grpc++
"%devenv%" grpc.sln /build "Debug|x64" /project grpc++_unsecure
if not %ERRORLEVEL% == 0 goto Finish
robocopy /mir .\x64\Debug ..\bin\grpc\debug
"%devenv%" grpc.sln /build "Release|x64" /project grpc++
"%devenv%" grpc.sln /build "Release|x64" /project grpc++_unsecure
if not %ERRORLEVEL% == 0 goto Finish
robocopy /mir .\x64\Release ..\bin\grpc\release /XF *grpc_cpp_plugin*
"%devenv%" grpc.sln /clean "Debug"
"%devenv%" grpc.sln /clean "Release"
"%devenv%" grpc.sln /build "Debug-DLL|x64" /project grpc++
"%devenv%" grpc.sln /build "Debug-DLL|x64" /project grpc++_unsecure
if not %ERRORLEVEL% == 0 goto Finish
robocopy /mir .\x64\Debug-DLL ..\bin\grpc\debug_dll
"%devenv%" grpc.sln /build "Release-DLL|x64" /project grpc++
"%devenv%" grpc.sln /build "Release-DLL|x64" /project grpc++_unsecure
if not %ERRORLEVEL% == 0 goto Finish
robocopy /mir .\x64\Release-DLL ..\bin\grpc\release_dll /XF *grpc_cpp_plugin*
robocopy /mir .\packages\grpc.dependencies.openssl.1.0.204.1\build\native\lib\v140\x64\Release\static ..\bin\dependencies
echo -----grpc building done-----
cd ../../
echo -----Building pb files-----
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\acquisition.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\analysis_configuration.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\data.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\device.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\instance.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\keystore.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\log.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\manager.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\minion_device.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\promethion_device.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\protocol.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\rpc_options.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --grpc_out=include\minknow\rpc\ --plugin=protoc-gen-grpc=grpc\bin\grpc_protoc_plugins\grpc_cpp_plugin.exe include\minknow\rpc\statistics.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\acquisition.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\analysis_configuration.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\data.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\device.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\instance.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\keystore.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\log.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\manager.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\minion_device.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\promethion_device.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\protocol.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\rpc_options.proto
grpc\bin\protobuf\release\protoc.exe -I include\minknow\rpc\ -I grpc\third_party\protobuf\src\ --cpp_out=include\minknow\rpc\ include\minknow\rpc\statistics.proto
echo -----pb building done-----
echo -----building pthreads-----
cd pthread-win32
"%devenv%" pthread.2015.sln /build "Release|x64" /project pthread_dll
if not %ERRORLEVEL% == 0 goto Finish
"%devenv%" pthread.2015.sln /build "Release|x64" /project pthread_lib
if not %ERRORLEVEL% == 0 goto Finish
robocopy .\bin\x64_MSVC2015.Release\ ..\lib\ /XF *.exp *.map
echo -----pthread building done-----
:Finish
popd
endlocal
pause