Skip to content
Snippets Groups Projects
Unverified Commit 3d6d390f authored by gendx's avatar gendx Committed by GitHub
Browse files

Merge pull request #20 from gendx/features-crypto-bench

Pass features to crypto bench example.
parents 8cbffc5e f452b2de
No related branches found
No related tags found
No related merge requests found
...@@ -148,15 +148,19 @@ build_app_padding () { ...@@ -148,15 +148,19 @@ build_app_padding () {
) | xxd -p -r > "${tab_folder}/padding.bin" ) | xxd -p -r > "${tab_folder}/padding.bin"
} }
build_app () { comma_separated () {
# Flatten the array # Flatten the array
# This is equivalent to the following python snippet: ' '.join(arr).replace(' ', ',') # This is equivalent to the following python snippet: ' '.join(arr).replace(' ', ',')
local feature_list=$(IFS=$'\n'; echo "$@") local list=$(IFS=$'\n'; echo "$@")
if [ "X${feature_list}" != "X" ] if [ "X${list}" != "X" ]
then then
feature_list="${feature_list// /,}" feature_list="${list// /,}"
fi fi
echo ${list}
}
build_app () {
local feature_list="$(comma_separated "$@")"
cargo build \ cargo build \
--release \ --release \
--target=thumbv7em-none-eabi \ --target=thumbv7em-none-eabi \
...@@ -176,9 +180,11 @@ build_app () { ...@@ -176,9 +180,11 @@ build_app () {
} }
build_crypto_bench () { build_crypto_bench () {
local feature_list="$(comma_separated "$@")"
cargo build \ cargo build \
--release \ --release \
--target=thumbv7em-none-eabi \ --target=thumbv7em-none-eabi \
--features="${feature_list}" \
--example crypto_bench --example crypto_bench
mkdir -p "target/tab" mkdir -p "target/tab"
...@@ -310,7 +316,7 @@ fi ...@@ -310,7 +316,7 @@ fi
if [ "$install_app" = "crypto_bench" ] if [ "$install_app" = "crypto_bench" ]
then then
build_crypto_bench build_crypto_bench "${!enabled_features[@]}"
fi fi
if [ "$install_app" != "none" ] if [ "$install_app" != "none" ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment