Skip to content

Commit

Permalink
Update build settings to include x86_64 arch
Browse files Browse the repository at this point in the history
Set the debug configuration to NATIVE_ARCH_ACTUAL because NATIVE_ARCH will always be i386

Move the "compile libgit2" script build phase to it's own target. By setting the script to run in it's own target we get the ability to clean it durning the clean phase (normal build phase scripts don't run during clean). This will be needed if someone has built GitX prior to this commit because the object files will be for the old architectures.

Also give an error if there is no git repository. This is from several questions I've received after someone has downloaded the source from github instead of cloning the project. The problem is that there is no submodule setting to update.
  • Loading branch information
brotherbard committed Jul 5, 2010
1 parent d81645e commit de7d74c
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 15 deletions.
79 changes: 64 additions & 15 deletions GitX.xcodeproj/project.pbxproj
Expand Up @@ -189,6 +189,13 @@
remoteGlobalIDString = 913D5E480E55644600CECEA2;
remoteInfo = "cli tool";
};
D8022C1911DFE8ED003C21F6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = D8022B1411DFCE7F003C21F6;
remoteInfo = libgit2;
};
F5643A010F792B4900A579C2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
Expand Down Expand Up @@ -251,6 +258,7 @@
93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitMessageView.m; sourceTree = "<group>"; };
93FCCBA80EA8AF450061B02B /* PBGitConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitConfig.m; sourceTree = "<group>"; };
D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = "<group>"; };
D8022A3411DFCCA5003C21F6 /* build_libgit2.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build_libgit2.sh; sourceTree = "<group>"; };
D8083A2D111E045300337480 /* PBRemoteProgressSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBRemoteProgressSheet.h; sourceTree = "<group>"; };
D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBRemoteProgressSheet.m; sourceTree = "<group>"; };
D8083C42111F106800337480 /* PBAddRemoteSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBAddRemoteSheet.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -554,6 +562,7 @@
32CA4F630368D1EE00C91783 /* GitX_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
F5E92A220E88569500056E75 /* new_file.png */,
D8022A3411DFCCA5003C21F6 /* build_libgit2.sh */,
);
name = "Other Sources";
sourceTree = "<group>";
Expand Down Expand Up @@ -905,12 +914,27 @@
};
/* End PBXHeadersBuildPhase section */

/* Begin PBXLegacyTarget section */
D8022B1411DFCE7F003C21F6 /* libgit2 */ = {
isa = PBXLegacyTarget;
buildArgumentsString = "\"${PROJECT_DIR}/build_libgit2.sh\"";
buildConfigurationList = D8022B1C11DFCE98003C21F6 /* Build configuration list for PBXLegacyTarget "libgit2" */;
buildPhases = (
);
buildToolPath = /bin/sh;
dependencies = (
);
name = libgit2;
passBuildSettingsInEnvironment = 1;
productName = libgit2;
};
/* End PBXLegacyTarget section */

/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* GitX */ = {
isa = PBXNativeTarget;
buildConfigurationList = 26FC0A840875C7B200E6366F /* Build configuration list for PBXNativeTarget "GitX" */;
buildPhases = (
F5792DFB0EDB570C001B0C31 /* Compile libgit2 */,
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
Expand All @@ -922,6 +946,7 @@
dependencies = (
913D5E5A0E5564F400CECEA2 /* PBXTargetDependency */,
F5643A020F792B4900A579C2 /* PBXTargetDependency */,
D8022C1A11DFE8ED003C21F6 /* PBXTargetDependency */,
);
name = GitX;
productInstallPath = "$(HOME)/Applications";
Expand Down Expand Up @@ -996,6 +1021,7 @@
F5886A0F0ED5D33D0066E74C /* SpeedTest */,
F56439F70F792B2100A579C2 /* Generate PList Prefix */,
F567CC38106E6B910059BB9D /* GitXTesting */,
D8022B1411DFCE7F003C21F6 /* libgit2 */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -1072,20 +1098,6 @@
shellPath = /bin/sh;
shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\nVERSION=$(cd \"$PROJECT_DIR\";git describe)\nLONG_VERSION=$(echo $VERSION | sed -e \"s/\\-/\\./\" -e \"s/^v//\" -e \"s/-.*//\")\nSHORT_VERSION=$(echo $VERSION | sed -e \"s/\\-.*//\" -e \"s/^v//\")\n\necho -n \"#define LONG_VERSION $LONG_VERSION\n#define GIT_VERSION $VERSION\n#define SHORT_VERSION $SHORT_VERSION\" > \"$PROJECT_TEMP_DIR/revision\"\ntouch Info.plist";
};
F5792DFB0EDB570C001B0C31 /* Compile libgit2 */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Compile libgit2";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\ngit submodule init\ngit submodule update\ncd libgit2\nrm -f libgit2.a\nmake CFLAGS=\"-arch i386 -arch ppc\"\nranlib libgit2.a";
};
F5CF04A20EAE696C00D75C81 /* Copy HTML files */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -1241,6 +1253,11 @@
target = 913D5E480E55644600CECEA2 /* cli tool */;
targetProxy = 913D5E590E5564F400CECEA2 /* PBXContainerItemProxy */;
};
D8022C1A11DFE8ED003C21F6 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = D8022B1411DFCE7F003C21F6 /* libgit2 */;
targetProxy = D8022C1911DFE8ED003C21F6 /* PBXContainerItemProxy */;
};
F5643A020F792B4900A579C2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = F56439F70F792B2100A579C2 /* Generate PList Prefix */;
Expand Down Expand Up @@ -1388,6 +1405,7 @@
26FC0A890875C7B200E6366F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
GCC_ENABLE_OBJC_GC = required;
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
Expand All @@ -1404,6 +1422,7 @@
ARCHS = (
ppc,
i386,
x86_64,
);
GCC_ENABLE_OBJC_GC = required;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
Expand Down Expand Up @@ -1462,6 +1481,27 @@
};
name = Release;
};
D8022B1511DFCE7F003C21F6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = libgit2;
};
name = Debug;
};
D8022B1611DFCE7F003C21F6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
PRODUCT_NAME = libgit2;
ZERO_LINK = NO;
};
name = Release;
};
F56439F80F792B2100A579C2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -1635,6 +1675,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D8022B1C11DFCE98003C21F6 /* Build configuration list for PBXLegacyTarget "libgit2" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D8022B1511DFCE7F003C21F6 /* Debug */,
D8022B1611DFCE7F003C21F6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
F56439FD0F792B3600A579C2 /* Build configuration list for PBXAggregateTarget "Generate PList Prefix" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
52 changes: 52 additions & 0 deletions build_libgit2.sh
@@ -0,0 +1,52 @@
#!/bin/sh

# build_libgit2.sh
# GitX
#
# Created by BrotherBard on 7/3/10.
# Copyright 2010 BrotherBard. All rights reserved.
#
# based on: http://log.yeahrightkeller.com/post/270155578/run-script-while-cleaning-in-xcode

buildAction () {
echo "Building libgit2..."
if [[ -d .git ]]
then
export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`"$TARGET_BUILD_DIR"/gitx --git-path`
git submodule init
git submodule update
cd libgit2
rm -f libgit2.a
make CFLAGS="-arch i386 -arch ppc -arch x86_64"
ranlib libgit2.a
else
echo "error: Not a git repository."
echo "error: clone GitX first so that the libgit2 submodule can be updated"
exit 1
fi
}

cleanAction () {
echo "Cleaning libgit2..."
cd libgit2
make clean
}

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# MAIN

#echo "Running with ACTION=${ACTION}"

case $ACTION in
# NOTE: it gets set to "" rather than "build" when doing a build.
"")
buildAction
;;

"clean")
cleanAction
;;
esac

exit 0

0 comments on commit de7d74c

Please sign in to comment.