Skip to content

Commit cf4c188

Browse files
authored
Update build_deps.sh
Signed-off-by: Evgeny Malygin <[email protected]>
1 parent 659b452 commit cf4c188

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

Diff for: docker/build_deps.sh

+29-12
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,33 @@
77

88
set -euxo pipefail
99

10-
if [ $# == 1 ]; then
11-
if [[ $1 == "--only-download" ]]; then
12-
DO_BUILD=false
13-
else
14-
echo "Unexpected optional argument, only '--only-download' is supported"
15-
exit 1
16-
fi
17-
else
18-
DO_BUILD=true
19-
fi
10+
DEPS_CONFIGURE_UFID="opt_64_cpp17"
11+
DEPS_SKIP_BUILD=0
12+
13+
usage()
14+
{
15+
echo "usage: ./build_deps.sh [--only-download] [--ufid <code>]"
16+
echo "where: "
17+
echo " --only-download Only download and configure dependencies, skip build"
18+
echo " --ufid <code> The unified flag identifiers for the build system [${DEPS_CONFIGURE_UFID}]"
19+
exit 1
20+
}
21+
22+
while true ; do
23+
case "$1" in
24+
--help)
25+
usage ;;
26+
--ufid)
27+
DEPS_CONFIGURE_UFID=$2 ; shift 2 ;;
28+
--only-download)
29+
DEPS_SKIP_BUILD=1 ; shift ;;
30+
--*)
31+
echo "Invalid option: ${1}"
32+
usage ;;
33+
*)
34+
break ;;
35+
esac
36+
done
2037

2138
fetch_git() {
2239
local org=$1
@@ -49,7 +66,7 @@ fetch_deps() {
4966
configure() {
5067
PATH="$PATH:$(realpath srcs/bde-tools/bin)"
5168
export PATH
52-
eval "$(bbs_build_env -u opt_64_cpp17)"
69+
eval "$(bbs_build_env -u ${DEPS_CONFIGURE_UFID})"
5370
}
5471

5572
build_bde() {
@@ -68,7 +85,7 @@ build_ntf() {
6885
--without-usage-examples \
6986
--without-applications \
7087
--without-warnings-as-errors \
71-
--ufid opt_64_cpp17
88+
--ufid ${DEPS_CONFIGURE_UFID}
7289
make -j8
7390
make install
7491
popd

0 commit comments

Comments
 (0)