Skip to content

Commit

Permalink
Merge pull request libgit2#68 from kronawetter/master
Browse files Browse the repository at this point in the history
iOS Build
  • Loading branch information
joshaber committed May 31, 2012
2 parents 7d58f07 + ee34bf9 commit 4428258
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 15 deletions.
38 changes: 24 additions & 14 deletions ObjectiveGitFramework.xcodeproj/project.pbxproj
Expand Up @@ -131,6 +131,8 @@
BDFAF9C9131C1868000508BC /* GTIndexEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = BDFAF9C7131C1868000508BC /* GTIndexEntry.h */; settings = {ATTRIBUTES = (Public, ); }; };
BDFAF9CA131C1868000508BC /* GTIndexEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = BDFAF9C8131C1868000508BC /* GTIndexEntry.m */; };
BDFAF9CE131C18FE000508BC /* GTIndexTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BDFAF9CD131C18FE000508BC /* GTIndexTest.m */; };
E9FFC6BF1577CC8300A9E736 /* GTConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 88EB7E4C14AEBA600046FEA4 /* GTConfiguration.m */; };
E9FFC6C01577CC8A00A9E736 /* GTConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 88EB7E4B14AEBA600046FEA4 /* GTConfiguration.h */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -517,6 +519,7 @@
04DB465D133AB5E200D9C624 /* GTSignature.h in Headers */,
04DB465E133AB5E200D9C624 /* GTBranch.h in Headers */,
AA046113134F4D2000DF526B /* GTOdbObject.h in Headers */,
E9FFC6C01577CC8A00A9E736 /* GTConfiguration.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -739,6 +742,7 @@
AA046115134F4D2000DF526B /* GTOdbObject.m in Sources */,
55C8054F13861FE7004DCB0F /* GTObjectDatabase.m in Sources */,
55C8057C13875579004DCB0F /* NSString+Git.m in Sources */,
E9FFC6BF1577CC8300A9E736 /* GTConfiguration.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -842,22 +846,22 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Frameworks\"",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_GC = unsupported;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREFIX_HEADER = ObjectiveGitFramework_Prefix.pch;
HEADER_SEARCH_PATHS = "$(SRCROOT)/libgit2/include";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/libgit2/lib\"",
"\"$(SRCROOT)\"",
);
PRODUCT_NAME = "ObjectiveGit-iOS";
SDKROOT = iphoneos;
VALID_ARCHS = "i386 armv7";
};
name = Debug;
};
Expand All @@ -866,21 +870,21 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Frameworks\"",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_ENABLE_OBJC_GC = unsupported;
GCC_PREFIX_HEADER = ObjectiveGitFramework_Prefix.pch;
HEADER_SEARCH_PATHS = "$(SRCROOT)/libgit2/include";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/libgit2/lib\"",
"\"$(SRCROOT)\"",
);
PRODUCT_NAME = "ObjectiveGit-iOS";
SDKROOT = iphoneos;
VALID_ARCHS = "i386 armv7";
ZERO_LINK = NO;
};
name = Release;
Expand Down Expand Up @@ -1086,20 +1090,22 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Frameworks\"",
);
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_GC = unsupported;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/UIKit.framework/Headers/UIKit.h";
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/libgit2/include\"";
INFOPLIST_FILE = "Tests-iOS-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/libgit2/lib\"",
Expand All @@ -1113,26 +1119,29 @@
);
PRODUCT_NAME = "Tests-iOS";
SDKROOT = iphoneos;
VALID_ARCHS = "i386 armv7";
};
name = Debug;
};
BDD9C3D9133BA557003708E7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Frameworks\"",
);
GCC_ENABLE_OBJC_GC = unsupported;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/UIKit.framework/Headers/UIKit.h";
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/libgit2/include\"";
INFOPLIST_FILE = "Tests-iOS-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/libgit2/lib\"",
Expand All @@ -1146,6 +1155,7 @@
);
PRODUCT_NAME = "Tests-iOS";
SDKROOT = iphoneos;
VALID_ARCHS = "i386 armv7";
ZERO_LINK = NO;
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion libgit2
Submodule libgit2 updated 1 files
+1 −1 src/diff_output.c
Binary file added libgit2-ios.a
Binary file not shown.
Binary file modified libgit2.a
Binary file not shown.
59 changes: 59 additions & 0 deletions update_libgit2_ios.sh
@@ -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."

0 comments on commit 4428258

Please sign in to comment.