automerge/scripts/ci/cmake-build
Conrad Irwin c3932e6267
Improve docs for building automerge-c on a mac (#465)
* More detailed instructions in README

I struggled to get the project to build for a while when first getting
started, so have added some instructions; and also some usage
instructions for automerge-c that show more clearly what is happening
without `AMpush()`
2022-12-09 13:46:23 +00:00

18 lines
624 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 [ "$(echo "${LIB_TYPE}" | tr '[:upper:]' '[:lower:]')" == "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;