forked from libgit2/objective-git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request libgit2#68 from kronawetter/master
iOS Build
- Loading branch information
Showing
5 changed files
with
84 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule libgit2
updated
1 files
+1 −1 | src/diff_output.c |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
set -e | ||
|
||
ios_version="5.1"; | ||
|
||
cd "libgit2" | ||
|
||
LIBGIT2_BRANCH="development" | ||
|
||
git checkout "${LIBGIT2_BRANCH}" | ||
git pull | ||
|
||
# armv7 build | ||
|
||
if [ -d "build" ]; then | ||
rm -rf "build" | ||
fi | ||
|
||
mkdir build | ||
cd build | ||
|
||
cmake -DCMAKE_C_COMPILER_WORKS:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_C_COMPILER=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -DCMAKE_OSX_ARCHITECTURES:STRING=armv7 -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${ios_version}.sdk/ .. | ||
cmake --build . | ||
|
||
product="libgit2.a" | ||
install_path="../../libgit2-ios-armv7.a" | ||
if [ "${product}" -nt "${install_path}" ]; then | ||
cp -v "${product}" "${install_path}" | ||
fi | ||
|
||
cd ../ | ||
|
||
# i386 build | ||
|
||
if [ -d "build" ]; then | ||
rm -rf "build" | ||
fi | ||
|
||
mkdir build | ||
cd build | ||
|
||
cmake -DCMAKE_C_COMPILER_WORKS:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_C_COMPILER=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -DCMAKE_OSX_ARCHITECTURES:STRING=i386 -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${ios_version}.sdk/ .. | ||
cmake --build . | ||
|
||
product="libgit2.a" | ||
install_path="../../libgit2-ios-i386.a" | ||
if [ "${product}" -nt "${install_path}" ]; then | ||
cp -v "${product}" "${install_path}" | ||
fi | ||
|
||
cd ../../ | ||
|
||
# link static libraries | ||
libtool -static libgit2-ios-armv7.a libgit2-ios-i386.a -o libgit2-ios.a | ||
|
||
# cleanup | ||
rm libgit2-ios-armv7.a | ||
rm libgit2-ios-i386.a | ||
|
||
echo "libgit2-ios has been updated." |