mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
35 lines
676 B
Bash
Executable File
35 lines
676 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
# augment path to help it find cmake installed in /usr/local/bin,
|
|
# e.g. via brew. Xcode's Run Script phase doesn't seem to honor
|
|
# ~/.MacOSX/environment.plist
|
|
PATH="/usr/local/bin:$PATH"
|
|
|
|
if [ "External/libgit2.a" -nt "External/libgit2" ]
|
|
then
|
|
echo "No update needed."
|
|
exit 0
|
|
fi
|
|
|
|
cd "External/libgit2"
|
|
|
|
if [ -d "build" ]; then
|
|
rm -rf "build"
|
|
fi
|
|
|
|
mkdir build
|
|
cd build
|
|
|
|
cmake -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_CLAR:BOOL=OFF -DTHREADSAFE:BOOL=ON ..
|
|
cmake --build .
|
|
|
|
product="libgit2.a"
|
|
install_path="../../${product}"
|
|
if [ "${product}" -nt "${install_path}" ]; then
|
|
cp -v "${product}" "${install_path}"
|
|
fi
|
|
|
|
echo "libgit2 has been updated."
|