| 1 |
#!/bin/bash |
| 2 |
############################################################################### |
| 3 |
# Copyright (C) Intel Corporation |
| 4 |
# |
| 5 |
# SPDX-License-Identifier: MIT |
| 6 |
############################################################################### |
| 7 |
# Build in typical fashion. |
| 8 |
set -o errexit ; set -o nounset |
| 9 |
|
| 10 |
if [ -z "$BASH_VERSION" ]; then |
| 11 |
echo "This script must be run under bash" |
| 12 |
exit 1 |
| 13 |
fi |
| 14 |
|
| 15 |
script_dir="$( cd "$(dirname "${BASH_SOURCE[0]:-$0}")" >/dev/null 2>&1 ; pwd -P )" |
| 16 |
|
| 17 |
source_dir="$(dirname "$script_dir")" |
| 18 |
build_dir="$source_dir/_build" |
| 19 |
staging_dir="$source_dir/_install" |
| 20 |
|
| 21 |
cmake -B "$build_dir" -S "$source_dir" \ |
| 22 |
-DBUILD_TESTS=ON \ |
| 23 |
-DCMAKE_BUILD_TYPE=Release \ |
| 24 |
-DCMAKE_INSTALL_LIBDIR=lib \ |
| 25 |
-DENABLE_WARNING_AS_ERROR=ON |
| 26 |
|
| 27 |
cmake --build "$build_dir" --parallel $(nproc) --verbose |
| 28 |
|
| 29 |
pushd "$build_dir" |
| 30 |
cpack . |
| 31 |
popd |
| 32 |
|
| 33 |
cmake --install "$build_dir" --prefix "$staging_dir" --config Release --strip |