Skip to content

Commit 23708ea

Browse files
Enhance build scripts to enable a debug build
Useful when using these scripts for development Signed-off-by: Richard Barton <[email protected]>
1 parent 3526ec9 commit 23708ea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

build-flang.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ OPTIND=1 # Reset in case getopts has been used previously in the shell.
55

66
# Initialize our own variables:
77
TARGET="X86"
8+
BUILD_TYPE="Release"
89
INSTALL_PREFIX="/usr/local"
910
NPROC=1
1011
USE_CCACHE="0"
@@ -24,15 +25,17 @@ function print_usage {
2425
echo "";
2526
echo "Options:";
2627
echo " -t Target to build for (X86, AArch64, PowerPC). Default: X86";
28+
echo " -d CMake build type. Default: Release";
2729
echo " -p Install prefix. Default: /usr/local";
2830
echo " -n Number of parallel jobs. Default: 1";
2931
echo " -c Use ccache. Default: 0 - do not use ccache";
3032
echo " -s Use sudo to install. Default: 0 - do not use sudo";
3133
}
3234

33-
while getopts "t:p:n:c?s?" opt; do
35+
while getopts "t:d:p:n:c?s?" opt; do
3436
case "$opt" in
3537
t) TARGET=$OPTARG;;
38+
d) BUILD_TYPE=$OPTARG;;
3639
p) INSTALL_PREFIX=$OPTARG;;
3740
n) NPROC=$OPTARG;;
3841
c) USE_CCACHE="1";;
@@ -42,7 +45,7 @@ while getopts "t:p:n:c?s?" opt; do
4245
done
4346

4447
CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
45-
-DCMAKE_BUILD_TYPE=Release \
48+
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
4649
-DCMAKE_CXX_COMPILER=$INSTALL_PREFIX/bin/clang++ \
4750
-DCMAKE_C_COMPILER=$INSTALL_PREFIX/bin/clang \
4851
-DLLVM_TARGETS_TO_BUILD=$TARGET"

0 commit comments

Comments
 (0)