Skip to content

Commit e35f4b0

Browse files
committed
Build variables consistency.
1 parent b404c6b commit e35f4b0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cppbuild/cppbuild

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
SOURCE_DIR="$(pwd)"
4-
BUILD_DIR="$(pwd)/cppbuild/Release"
4+
BUILD_DIR="${SOURCE_DIR}/cppbuild/Release"
55

66
ncpus=1
77
case "$(uname)" in
@@ -13,13 +13,14 @@ case "$(uname)" in
1313
;;
1414
esac
1515

16-
echo "Will make with \"-j $ncpus\"."
16+
echo "Will make with \"-j ${ncpus}\"."
1717

18-
if [ -d "$BUILD_DIR" ] ; then
19-
echo "Build directory ($BUILD_DIR) exists, removing."
20-
rm -rf "$BUILD_DIR"
18+
if [ -d "${BUILD_DIR}" ] ; then
19+
echo "Build directory (${BUILD_DIR}) exists, removing."
20+
rm -rf "${BUILD_DIR}"
2121
fi
2222

23-
mkdir -p "$BUILD_DIR"
23+
mkdir -p "${BUILD_DIR}"
24+
cd "${BUILD_DIR}" || exit
2425

25-
(cd "$BUILD_DIR" && cmake -G "Unix Makefiles" "$SOURCE_DIR" && make clean && make -j "$ncpus" all && ctest -C Release --output-on-failure)
26+
(cmake -G "Unix Makefiles" "${SOURCE_DIR}" && make clean && make -j ${ncpus} all && ctest -C Release --output-on-failure)

0 commit comments

Comments
 (0)