Skip to content

Commit

Permalink
use MCS verified config if available
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Heider <[email protected]>
  • Loading branch information
axel-h committed Jan 5, 2024
1 parent 47f7b21 commit e204c30
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions standalone-kernel/compile_kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,17 @@ do_compile_kernel()

variant_info=""
build_folder=build
config_prefix="${INPUT_ARCH}"
extra_params=""
if [ ! -z "${variant}" ]; then
case "${variant}" in
MCS)
extra_params="${extra_params} -DKernelIsMCS=TRUE"
if [ -f configs/${config_prefix}_MCS_verified.cmake ]; then
config_prefix="${config_prefix}_MCS"
else
# just use the default and enable MCS
extra_params="${extra_params} -DKernelIsMCS=TRUE"
fi
;;
*)
echo "Unknown variant '${variant}'"
Expand All @@ -74,10 +80,20 @@ do_compile_kernel()
build_folder="${build_folder}-${variant}"
fi

# Unfortunately, CMake does not halt with a nice and clear error if the
# config file does not exist. Instead, it logs an error that it could not
# process the file and continues as if the file was empty. This causes some
# rather odd errors later, so it's better to fail here with a clear message.
config_file="configs/${config_prefix}_verified.cmake"
if [ ! -f "${config_file}" ]; then
echo "missing config file '${config_file}'"
exit 1
fi

echo "::group::Run CMake${variant_info}"
( # run in sub shell
set -x
cmake -G Ninja -B ${build_folder} -C configs/${INPUT_ARCH}_verified.cmake ${toolchain_flags} ${extra_params}
cmake -G Ninja -B ${build_folder} -C ${config_file} ${toolchain_flags} ${extra_params}
)
echo "::endgroup::"

Expand Down

0 comments on commit e204c30

Please sign in to comment.