Skip to content

Commit dccfbc8

Browse files
jwnrtluismarques
authored andcommitted
Allow Clang build type to be configured
1 parent b0efe7a commit dccfbc8

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

.github/workflows/toolchain_build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jobs:
8282
run: |
8383
./build-clang-with-args.sh \
8484
"lowrisc-toolchain-${{ matrix.name }}" \
85+
Release \
8586
"${{ matrix.target }}" \
8687
"${{ matrix.output_dir }}" \
8788
"${{ matrix.march }}" \

build-clang-with-args.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,20 @@ fi;
2525
## Take configuration from arguments
2626
# This is the name for the tar file.
2727
toolchain_name="${1}"
28+
# This is the CMake build type (e.g. Release, Debug, RelWithDebInfo)
29+
build_type="${2}"
2830
# This is the expected target triple (so we can set a default)
29-
toolchain_target="${2}"
31+
toolchain_target="${3}"
3032
# This is the directory where we want the toolchain to added to
31-
toolchain_dest="${3}"
33+
toolchain_dest="${4}"
3234
# -march option default value
33-
march="${4}"
35+
march="${5}"
3436
# -mabi option default value
35-
mabi="${5}"
37+
mabi="${6}"
3638
# -mcmodel option default value
37-
mcmodel="${6}"
39+
mcmodel="${7}"
3840
# Remaining cflags for build configurations
39-
toolchain_cflags=("${@:7}")
41+
toolchain_cflags=("${@:8}")
4042

4143
build_top_dir="${PWD}"
4244

@@ -106,7 +108,7 @@ llvm_distribution_components+=";${llvm_tools}"
106108

107109
cmake "${llvm_dir}/llvm" \
108110
-Wno-dev \
109-
-DCMAKE_BUILD_TYPE=Release \
111+
-DCMAKE_BUILD_TYPE="${build_type}" \
110112
-DCMAKE_INSTALL_PREFIX="${toolchain_dest}" \
111113
-DLLVM_TARGETS_TO_BUILD="RISCV" \
112114
-DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" \

0 commit comments

Comments
 (0)