You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
common-dependency-build-hel.../buildcode/cryptopp.code

36 lines
1.2 KiB

if [ -f "${LIB_DIR}/libcryptopp.a" ]; then
echo "lib exists already in ${LIB_DIR}. If you want to rebuild it, delete the existing one."
exit 0
fi
CRYPTOPP_DIR="${TMP_DIR}/cryptopp"
if [ ! -d "${CRYPTOPP_DIR}" ]; then
git clone -b CRYPTOPP_8_5_0 https://github.com/weidai11/cryptopp
fi
pushd ${CRYPTOPP_DIR}
export CXX="$(xcrun --sdk ${SDK} -f clang++) -arch ${ARCH} -isysroot ${SDK_PATH} -stdlib=libc++"
export CFLAGS="-arch ${ARCH} -isysroot ${SDK_PATH} -std=c14"
export LDFLAGS="-arch ${ARCH}"
export CC="$(xcrun --sdk ${SDK} -f clang) -arch ${ARCH} -isysroot ${SDK_PATH}-target ${TARGET}"
export PREFIX=${CURRENT_LIB_DIR}
if [ "${ARCH}" == "x86_64" ]; then
export CXXFLAGS="-arch ${ARCH} -isysroot ${SDK_PATH} -mmacosx-version-min=10.10"
make clean
make -j4
make install
elif [ "${ARCH}" == "arm64" ]; then
export CXXFLAGS="-arch ${ARCH} -isysroot ${SDK_PATH} -mmacosx-version-min=11.0 -DDISABLE_NATIVE_ARCH=1 -DCRYPTOPP_ARM_CRC32_AVAILABLE=0"
make clean
make -j4
make install
else
echo "Error: Unhandled arch!"
exit 1
fi
popd
unset PREFIX
unset CXXFLAGS
unset CXX
unset CFLAGS
unset LDFLAGS
unset CC