sc3dev/cmake-build-and-test.sh

21 lines
566 B
Bash
Executable File

#!/usr/bin/env bash
######################################################################
# @author : kyle (kyleimap.cc)
# @file : setup-cmake
# @created : Wednesday Oct 18, 2023 04:24:21 PDT
#
# @description : Prepare a CMake build environment, build, and test.
######################################################################
set -eux
if [ "${USE_CLANG:-}" == "yes" ]
then
export CC=$(command -v clang)
export CXX=$(command -v clang++)
fi
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. && make all test && ctest