#!/bin/bash

# directory as demo name
TEST_NAME=${PWD##*/}

SRC=${TEST_NAME}.mm
if [ ! -f ${SRC} ]; then
	SRC=${TEST_NAME}.m
fi

case $(uname -m) in
    x86_64)  clang++ -x objective-c++ -arch x86_64  -I ../../../include ${SRC} -L ../../../lib -Xlinker -rpath -Xlinker ../../../lib -Xlinker -export_dynamic -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -lfsdk_oc_mac64 -lssl -lcrypto -o ${TEST_NAME};;
    arm64) clang++ -x objective-c++ -arch arm64  -I ../../../include ${SRC} -L ../../../lib -Xlinker -rpath -Xlinker ../../../lib -Xlinker -export_dynamic -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -lfsdk_oc_macarm -lssl -lcrypto -o ${TEST_NAME};;
esac
./${TEST_NAME}
