automerge/scripts/ci/cmake-build
Alex Good dd3c6d1303
Move rust workspace into ./rust
After some discussion with PVH I realise that the repo structure in the
last reorg was very rust-centric. In an attempt to put each language on
a level footing move the rust code and project files into ./rust
2022-10-16 19:55:51 +01:00

18 lines
587 B
Bash
Executable file

#!/usr/bin/env bash
set -eoux pipefail
THIS_SCRIPT=$(dirname "$0");
# \note CMake's default build types are "Debug", "MinSizeRel", "Release" and
# "RelWithDebInfo" but custom ones can also be defined so we pass it verbatim.
BUILD_TYPE=$1;
LIB_TYPE=$2;
if [ "${LIB_TYPE,,}" == "shared" ]; then
SHARED_TOGGLE="ON"
else
SHARED_TOGGLE="OFF"
fi
C_PROJECT=$THIS_SCRIPT/../../rust/automerge-c;
mkdir -p $C_PROJECT/build;
cd $C_PROJECT/build;
cmake --log-level=ERROR -B . -S .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_SHARED_LIBS=$SHARED_TOGGLE;
cmake --build . --target test_automerge;