Skip to content

Commit 6d8982a

Browse files
committed
Build with WAF outside of source tree.
Update headers and search paths with new build logic.
1 parent 2a2761d commit 6d8982a

File tree

7 files changed

+32
-21
lines changed

7 files changed

+32
-21
lines changed

GitX.xcodeproj/project.pbxproj

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@
503503
F5B721C30E05CF7E00AF29DC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
504504
F5C007730E731B48007B84B2 /* PBGitRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRef.h; sourceTree = "<group>"; };
505505
F5C007740E731B48007B84B2 /* PBGitRef.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRef.m; sourceTree = "<group>"; };
506-
F5C580E40EDA250900995434 /* libgit2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgit2.a; path = libgit2/libgit2.a; sourceTree = "<group>"; };
506+
F5C580E40EDA250900995434 /* libgit2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgit2.a; sourceTree = BUILT_PRODUCTS_DIR; };
507507
F5C6F68B0E65FF9300478D97 /* PBGitLane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitLane.h; sourceTree = "<group>"; };
508508
F5C6F68C0E65FF9300478D97 /* PBGitLane.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PBGitLane.mm; sourceTree = "<group>"; };
509509
F5D2DC850EA401A80034AD24 /* PBGitConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitConfig.h; sourceTree = "<group>"; };
@@ -1616,13 +1616,14 @@
16161616
GCC_OPTIMIZATION_LEVEL = 0;
16171617
GCC_PRECOMPILE_PREFIX_HEADER = YES;
16181618
GCC_PREFIX_HEADER = GitX_Prefix.pch;
1619-
HEADER_SEARCH_PATHS = libgit2/src;
1619+
HEADER_SEARCH_PATHS = libgit2/include;
16201620
INFOPLIST_FILE = Info.plist;
16211621
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
16221622
INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision;
16231623
INFOPLIST_PREPROCESS = YES;
16241624
INSTALL_PATH = "$(HOME)/Applications";
1625-
LIBRARY_SEARCH_PATHS = libgit2;
1625+
LIBRARY_SEARCH_PATHS = "";
1626+
ONLY_ACTIVE_ARCH = YES;
16261627
PRODUCT_NAME = GitX;
16271628
SDKROOT = "";
16281629
WRAPPER_EXTENSION = app;
@@ -1643,13 +1644,13 @@
16431644
GCC_PRECOMPILE_PREFIX_HEADER = YES;
16441645
GCC_PREFIX_HEADER = GitX_Prefix.pch;
16451646
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "";
1646-
HEADER_SEARCH_PATHS = libgit2/src;
1647+
HEADER_SEARCH_PATHS = libgit2/include;
16471648
INFOPLIST_FILE = Info.plist;
16481649
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
16491650
INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision;
16501651
INFOPLIST_PREPROCESS = YES;
16511652
INSTALL_PATH = "$(HOME)/Applications";
1652-
LIBRARY_SEARCH_PATHS = libgit2;
1653+
LIBRARY_SEARCH_PATHS = "";
16531654
PRODUCT_NAME = GitX;
16541655
SDKROOT = "";
16551656
WRAPPER_EXTENSION = app;
@@ -1771,7 +1772,8 @@
17711772
GCC_PRECOMPILE_PREFIX_HEADER = YES;
17721773
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
17731774
INSTALL_PATH = /usr/local/bin;
1774-
LIBRARY_SEARCH_PATHS = libgit2;
1775+
LIBRARY_SEARCH_PATHS = "";
1776+
ONLY_ACTIVE_ARCH = YES;
17751777
OTHER_LDFLAGS = (
17761778
"-framework",
17771779
Foundation,
@@ -1795,7 +1797,7 @@
17951797
GCC_PRECOMPILE_PREFIX_HEADER = YES;
17961798
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
17971799
INSTALL_PATH = /usr/local/bin;
1798-
LIBRARY_SEARCH_PATHS = libgit2;
1800+
LIBRARY_SEARCH_PATHS = "";
17991801
OTHER_LDFLAGS = (
18001802
"-framework",
18011803
Foundation,

PBGitGrapher.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#import "PBGitLane.h"
1212
#import "PBGitGraphLine.h"
1313
#import <list>
14-
#import "git/oid.h"
14+
#import <git2/oid.h>
1515

1616
using namespace std;
1717

PBGitLane.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright 2008 __MyCompanyName__. All rights reserved.
77
//
88
#import <Cocoa/Cocoa.h>
9-
#include "git/oid.h"
9+
#include <git2/oid.h>
1010

1111
class PBGitLane {
1212
static int s_colorIndex;

PBGitSHA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import <Cocoa/Cocoa.h>
10-
#include "git/oid.h"
10+
#include <git2/oid.h>
1111

1212

1313
@interface PBGitSHA : NSObject <NSCopying> {

PBGitSHA.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import "PBGitSHA.h"
10-
10+
#import <git2/errors.h>
1111

1212
@interface PBGitSHA ()
1313

build_libgit2.sh

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,29 @@
99
# based on: http://log.yeahrightkeller.com/post/270155578/run-script-while-cleaning-in-xcode
1010

1111
buildAction () {
12-
echo "Building libgit2..."
12+
echo "Building libgit2..."
1313
if [[ -d .git ]]
1414
then
15-
if [ "$(which git)" == "" ]; then
16-
echo "git not found"
17-
exit -1
18-
fi
15+
if [ "$(which git)" == "" ]; then
16+
echo "git not found"
17+
exit -1
18+
fi
1919
git submodule init
2020
git submodule sync
2121
git submodule update
2222
cd libgit2
23-
rm -f libgit2.a
24-
make CFLAGS="-arch i386 -arch ppc"
25-
ranlib libgit2.a
23+
./waf --out=$TARGET_TEMP_DIR --prefix=$TARGET_BUILD_DIR configure
24+
if [ $? != 0 ]; then
25+
echo "error: failed to waf configure"
26+
exit -1
27+
fi
28+
./waf build-static
29+
if [ $? != 0 ]; then
30+
echo "error: failed to waf build-static"
31+
exit -1
32+
fi
33+
ranlib $TARGET_TEMP_DIR/static/libgit2.a
34+
cp $TARGET_TEMP_DIR/static/libgit2.a $TARGET_BUILD_DIR
2635
else
2736
echo "error: Not a git repository."
2837
echo "error: clone GitX first so that the libgit2 submodule can be updated"
@@ -33,7 +42,7 @@ buildAction () {
3342
cleanAction () {
3443
echo "Cleaning libgit2..."
3544
cd libgit2
36-
make clean
45+
./waf clean
3746
}
3847

3948
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

libgit2

Submodule libgit2 updated 1 file

0 commit comments

Comments
 (0)