-
Notifications
You must be signed in to change notification settings - Fork 2
/
compileprotoc.sh
executable file
·47 lines (37 loc) · 1.02 KB
/
compileprotoc.sh
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
##!/bin/bash
if [ ! -d "$1" ]; then
echo "$1 is not a directory"
exit 1
fi
if [ ! -f "$1/$2" ]; then
echo "$1/$2 file not found!"
exit 1
fi
OLDCD=$(pwd)
cd $1
if [ -f "../../build/Release/protoc.exe" ]; then
echo ../../build/Release/protoc.exe --cxx_out=./ $2
../../build/Release/protoc.exe --cxx_out=./ $2
else
if [ -f "../../build/Debug/protoc.exe" ]; then
echo ../../build/Debug/protoc.exe --cxx_out=./ $2
../../build/Debug/protoc.exe --cxx_out=./ $2
fi
fi
if [ -f "../../tools/protobuf/build/Debug/protoc" ]; then
echo ../../tools/protobuf/build/Debug/protoc --cxx_out=./ $2
../../tools/protobuf/build/Debug/protoc --cxx_out=./ $2
else
if [ -f "../../tools/protobuf/build/Release/protoc" ]; then
echo ../../tools/protobuf/build/Release/protoc --cxx_out=./ $2
../../tools/protobuf/build/Release/protoc --cxx_out=./ $2
fi
fi
if [ -f "../../out/Debug/protoc" ]; then
../../out/Debug/protoc --cxx_out=./ $2
else
if [ -f "../../out/Release/protoc" ]; then
../../out/Release/protoc --cxx_out=./ $2
fi
fi
cd $OLDCD