Skip to content

Commit a3a3c13

Browse files
committed
Build system overhaul!
This changes our various scripts to dump their build artifacts in External/build instead of various per-external directories (or /tmp for OpenSSL), which makes it easier to link them to each other when we finally get to building libgit2 on iOS.
1 parent c978f21 commit a3a3c13

File tree

8 files changed

+123
-133
lines changed

8 files changed

+123
-133
lines changed

External/libcrypto.a

Lines changed: 0 additions & 1 deletion
This file was deleted.

External/libssl.a

Lines changed: 0 additions & 1 deletion
This file was deleted.

ObjectiveGitFramework.xcodeproj/project.pbxproj

Lines changed: 48 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,14 @@
9191
4D1C40D8182C006D00BE2960 /* GTBlobSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D1C40D7182C006D00BE2960 /* GTBlobSpec.m */; };
9292
4D79C0EE17DF9F4D00997DE4 /* GTCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D79C0EC17DF9F4D00997DE4 /* GTCredential.h */; settings = {ATTRIBUTES = (Public, ); }; };
9393
4D79C0EF17DF9F4D00997DE4 /* GTCredential.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D79C0ED17DF9F4D00997DE4 /* GTCredential.m */; };
94+
4D9BCD24206D84AD003CD3CE /* libgit2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D9BCD23206D84AD003CD3CE /* libgit2.a */; };
95+
4D9BCD25206D84B2003CD3CE /* libgit2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D9BCD23206D84AD003CD3CE /* libgit2.a */; };
9496
4DBA4A3217DA73CE006CD5F5 /* GTRemoteSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DBA4A3117DA73CE006CD5F5 /* GTRemoteSpec.m */; };
9597
4DC55AE51AD859AD0032563C /* GTCheckoutOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DC55AE31AD859AD0032563C /* GTCheckoutOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
9698
4DC55AE61AD859AD0032563C /* GTCheckoutOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DC55AE31AD859AD0032563C /* GTCheckoutOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
9799
4DC55AE71AD859AD0032563C /* GTCheckoutOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DC55AE41AD859AD0032563C /* GTCheckoutOptions.m */; };
98100
4DC55AE81AD859AD0032563C /* GTCheckoutOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DC55AE41AD859AD0032563C /* GTCheckoutOptions.m */; };
101+
4DFA918F207D0B87003CD3CE /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8D63865207ACCAA00D1FD32 /* Nimble.framework */; };
99102
4DFFB15B183AA8D600D1565E /* GTRepository+RemoteOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DFFB159183AA8D600D1565E /* GTRepository+RemoteOperations.h */; settings = {ATTRIBUTES = (Public, ); }; };
100103
4DFFB15C183AA8D600D1565E /* GTRepository+RemoteOperations.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DFFB15A183AA8D600D1565E /* GTRepository+RemoteOperations.m */; };
101104
55C8055013861FE7004DCB0F /* GTObjectDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C8054D13861F34004DCB0F /* GTObjectDatabase.m */; };
@@ -297,7 +300,7 @@
297300
D040AF78177B9A9E001AD9EB /* GTSignatureSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = D040AF77177B9A9E001AD9EB /* GTSignatureSpec.m */; };
298301
D05FC5E219FAD039008C9348 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A1F2FD317C6A8F3003DFADE /* libcrypto.a */; };
299302
D05FC5E319FAD03C008C9348 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A1F2FD417C6A8F3003DFADE /* libssl.a */; };
300-
D05FC5E419FAD040008C9348 /* libssh2-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A502B8617D6892D00BAF4A5 /* libssh2-ios.a */; };
303+
D05FC5E419FAD040008C9348 /* libssh2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A502B8617D6892D00BAF4A5 /* libssh2.a */; };
301304
D06D9E011755D10000558C17 /* GTEnumeratorSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = D06D9E001755D10000558C17 /* GTEnumeratorSpec.m */; };
302305
D0751CD918BE520400134314 /* GTFilterListSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = D0751CD818BE520400134314 /* GTFilterListSpec.m */; };
303306
D09C2E361755F16200065E36 /* GTSubmodule.h in Headers */ = {isa = PBXBuildFile; fileRef = D09C2E341755F16200065E36 /* GTSubmodule.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -490,6 +493,7 @@
490493
4D79C0EC17DF9F4D00997DE4 /* GTCredential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTCredential.h; sourceTree = "<group>"; };
491494
4D79C0ED17DF9F4D00997DE4 /* GTCredential.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTCredential.m; sourceTree = "<group>"; };
492495
4D79C0F617DFAA7100997DE4 /* GTCredential+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTCredential+Private.h"; sourceTree = "<group>"; };
496+
4D9BCD23206D84AD003CD3CE /* libgit2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgit2.a; path = External/build/lib/libgit2.a; sourceTree = "<group>"; };
493497
4DBA4A3117DA73CE006CD5F5 /* GTRemoteSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTRemoteSpec.m; sourceTree = "<group>"; };
494498
4DC55AE31AD859AD0032563C /* GTCheckoutOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTCheckoutOptions.h; sourceTree = "<group>"; };
495499
4DC55AE41AD859AD0032563C /* GTCheckoutOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTCheckoutOptions.m; sourceTree = "<group>"; };
@@ -503,9 +507,9 @@
503507
5BE612861745EE3300266D8C /* GTTreeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTTreeBuilder.h; sourceTree = "<group>"; };
504508
5BE612871745EE3300266D8C /* GTTreeBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTTreeBuilder.m; sourceTree = "<group>"; };
505509
5BE612921745EEBC00266D8C /* GTTreeBuilderSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTTreeBuilderSpec.m; sourceTree = "<group>"; };
506-
6A1F2FD317C6A8F3003DFADE /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = "External/ios-openssl/lib/libcrypto.a"; sourceTree = "<group>"; };
507-
6A1F2FD417C6A8F3003DFADE /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssl.a; path = "External/ios-openssl/lib/libssl.a"; sourceTree = "<group>"; };
508-
6A502B8617D6892D00BAF4A5 /* libssh2-ios.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libssh2-ios.a"; path = "External/libssh2-ios/lib/libssh2-ios.a"; sourceTree = "<group>"; };
510+
6A1F2FD317C6A8F3003DFADE /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = External/build/lib/libcrypto.a; sourceTree = "<group>"; };
511+
6A1F2FD417C6A8F3003DFADE /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssl.a; path = External/build/lib/libssl.a; sourceTree = "<group>"; };
512+
6A502B8617D6892D00BAF4A5 /* libssh2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssh2.a; path = External/build/lib/libssh2.a; sourceTree = "<group>"; };
509513
6EEB519F199D62B9001D72C0 /* GTFetchHeadEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTFetchHeadEntry.h; sourceTree = "<group>"; };
510514
6EEB51A0199D62B9001D72C0 /* GTFetchHeadEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTFetchHeadEntry.m; sourceTree = "<group>"; };
511515
79262F0E13C697BE00A4B1EA /* git2 */ = {isa = PBXFileReference; lastKnownFileType = folder; name = git2; path = External/libgit2/include/git2; sourceTree = "<group>"; };
@@ -682,6 +686,7 @@
682686
files = (
683687
F8D6385D207AC75100D1FD32 /* libz.tbd in Frameworks */,
684688
F8D6385C207AC74A00D1FD32 /* libiconv.tbd in Frameworks */,
689+
4D9BCD24206D84AD003CD3CE /* libgit2.a in Frameworks */,
685690
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */,
686691
);
687692
runOnlyForDeploymentPostprocessing = 0;
@@ -694,7 +699,8 @@
694699
F8D6385F207ACAE600D1FD32 /* libz.tbd in Frameworks */,
695700
D05FC5E319FAD03C008C9348 /* libssl.a in Frameworks */,
696701
D05FC5E219FAD039008C9348 /* libcrypto.a in Frameworks */,
697-
D05FC5E419FAD040008C9348 /* libssh2-ios.a in Frameworks */,
702+
D05FC5E419FAD040008C9348 /* libssh2.a in Frameworks */,
703+
4D9BCD25206D84B2003CD3CE /* libgit2.a in Frameworks */,
698704
);
699705
runOnlyForDeploymentPostprocessing = 0;
700706
};
@@ -705,6 +711,7 @@
705711
F84277BE207B104A008AB8E8 /* XCTest.framework in Frameworks */,
706712
F8D63868207ACCEE00D1FD32 /* Quick.framework in Frameworks */,
707713
F879D83C1B4B7F7D002D5C07 /* ObjectiveGit.framework in Frameworks */,
714+
4DFA918F207D0B87003CD3CE /* Nimble.framework in Frameworks */,
708715
F8D6386A207ACDDD00D1FD32 /* ZipArchive.framework in Frameworks */,
709716
);
710717
runOnlyForDeploymentPostprocessing = 0;
@@ -744,16 +751,17 @@
744751
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
745752
isa = PBXGroup;
746753
children = (
747-
1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */,
748754
306123A817EA5261006591D4 /* extobjc */,
749755
889923F919FF5DD40092A9A6 /* git2 */,
750756
6A1F2FD317C6A8F3003DFADE /* libcrypto.a */,
751757
F8D63860207ACAF600D1FD32 /* libiconv.tbd */,
752758
F8D6385B207AC74A00D1FD32 /* libiconv.tbd */,
753-
6A502B8617D6892D00BAF4A5 /* libssh2-ios.a */,
754-
6A1F2FD417C6A8F3003DFADE /* libssl.a */,
755759
23BB67BB1C7DF45300A37A66 /* libz.tbd */,
756760
F8D6385E207ACAE600D1FD32 /* libz.tbd */,
761+
6A1F2FD417C6A8F3003DFADE /* libssl.a */,
762+
6A502B8617D6892D00BAF4A5 /* libssh2.a */,
763+
4D9BCD23206D84AD003CD3CE /* libgit2.a */,
764+
1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */,
757765
D0A0128B19F9853D007F1914 /* Nimble.framework */,
758766
F8D63865207ACCAA00D1FD32 /* Nimble.framework */,
759767
D0A0128819F98475007F1914 /* Quick.framework */,
@@ -1681,6 +1689,10 @@
16811689
DYLIB_CURRENT_VERSION = 1;
16821690
FRAMEWORK_VERSION = A;
16831691
INFOPLIST_FILE = Info.plist;
1692+
LIBRARY_SEARCH_PATHS = (
1693+
"$(inherited)",
1694+
"$(PROJECT_DIR)/External/build/lib",
1695+
);
16841696
MODULEMAP_FILE = ObjectiveGit.modulemap;
16851697
OTHER_LDFLAGS = (
16861698
"-lgit2",
@@ -1705,6 +1717,10 @@
17051717
DYLIB_CURRENT_VERSION = 1;
17061718
FRAMEWORK_VERSION = A;
17071719
INFOPLIST_FILE = Info.plist;
1720+
LIBRARY_SEARCH_PATHS = (
1721+
"$(inherited)",
1722+
"$(PROJECT_DIR)/External/build/lib",
1723+
);
17081724
MODULEMAP_FILE = ObjectiveGit.modulemap;
17091725
OTHER_LDFLAGS = (
17101726
"-lgit2",
@@ -1940,6 +1956,10 @@
19401956
DYLIB_CURRENT_VERSION = 1;
19411957
FRAMEWORK_VERSION = A;
19421958
INFOPLIST_FILE = Info.plist;
1959+
LIBRARY_SEARCH_PATHS = (
1960+
"$(inherited)",
1961+
"$(PROJECT_DIR)/External/build/lib",
1962+
);
19431963
MODULEMAP_FILE = ObjectiveGit.modulemap;
19441964
OTHER_LDFLAGS = (
19451965
"-lgit2",
@@ -1988,22 +2008,15 @@
19882008
DYLIB_CURRENT_VERSION = 1;
19892009
HEADER_SEARCH_PATHS = (
19902010
"$(inherited)",
1991-
"External/libssh2-ios/include/libssh2",
1992-
External/libgit2/include,
2011+
External/build/include,
19932012
);
19942013
INFOPLIST_FILE = Info.plist;
1995-
LIBRARY_SEARCH_PATHS = (
1996-
"External/ios-openssl/lib",
1997-
"External/libssh2-ios/lib",
1998-
"External/libgit2-ios",
1999-
);
2014+
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/External/build/lib";
20002015
MODULEMAP_FILE = ObjectiveGit.modulemap;
2001-
OTHER_LDFLAGS = (
2002-
"-lgit2-ios",
2003-
"-all_load",
2004-
);
2016+
OTHER_LDFLAGS = "-all_load";
20052017
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
20062018
PRODUCT_NAME = ObjectiveGit;
2019+
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/External/libgit2/include";
20072020
VERSIONING_SYSTEM = "apple-generic";
20082021
VERSION_INFO_PREFIX = "";
20092022
};
@@ -2052,22 +2065,15 @@
20522065
DYLIB_CURRENT_VERSION = 1;
20532066
HEADER_SEARCH_PATHS = (
20542067
"$(inherited)",
2055-
"External/libssh2-ios/include/libssh2",
2056-
External/libgit2/include,
2068+
External/build/include,
20572069
);
20582070
INFOPLIST_FILE = Info.plist;
2059-
LIBRARY_SEARCH_PATHS = (
2060-
"External/ios-openssl/lib",
2061-
"External/libssh2-ios/lib",
2062-
"External/libgit2-ios",
2063-
);
2071+
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/External/build/lib";
20642072
MODULEMAP_FILE = ObjectiveGit.modulemap;
2065-
OTHER_LDFLAGS = (
2066-
"-lgit2-ios",
2067-
"-all_load",
2068-
);
2073+
OTHER_LDFLAGS = "-all_load";
20692074
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
20702075
PRODUCT_NAME = ObjectiveGit;
2076+
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/External/libgit2/include";
20712077
VERSIONING_SYSTEM = "apple-generic";
20722078
VERSION_INFO_PREFIX = "";
20732079
};
@@ -2084,22 +2090,15 @@
20842090
DYLIB_CURRENT_VERSION = 1;
20852091
HEADER_SEARCH_PATHS = (
20862092
"$(inherited)",
2087-
"External/libssh2-ios/include/libssh2",
2088-
External/libgit2/include,
2093+
External/build/include,
20892094
);
20902095
INFOPLIST_FILE = Info.plist;
2091-
LIBRARY_SEARCH_PATHS = (
2092-
"External/ios-openssl/lib",
2093-
"External/libssh2-ios/lib",
2094-
"External/libgit2-ios",
2095-
);
2096+
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/External/build/lib";
20962097
MODULEMAP_FILE = ObjectiveGit.modulemap;
2097-
OTHER_LDFLAGS = (
2098-
"-lgit2-ios",
2099-
"-all_load",
2100-
);
2098+
OTHER_LDFLAGS = "-all_load";
21012099
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
21022100
PRODUCT_NAME = ObjectiveGit;
2101+
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/External/libgit2/include";
21032102
VERSIONING_SYSTEM = "apple-generic";
21042103
VERSION_INFO_PREFIX = "";
21052104
};
@@ -2116,22 +2115,15 @@
21162115
DYLIB_CURRENT_VERSION = 1;
21172116
HEADER_SEARCH_PATHS = (
21182117
"$(inherited)",
2119-
"External/libssh2-ios/include/libssh2",
2120-
External/libgit2/include,
2118+
External/build/include,
21212119
);
21222120
INFOPLIST_FILE = Info.plist;
2123-
LIBRARY_SEARCH_PATHS = (
2124-
"External/ios-openssl/lib",
2125-
"External/libssh2-ios/lib",
2126-
"External/libgit2-ios",
2127-
);
2121+
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/External/build/lib";
21282122
MODULEMAP_FILE = ObjectiveGit.modulemap;
2129-
OTHER_LDFLAGS = (
2130-
"-lgit2-ios",
2131-
"-all_load",
2132-
);
2123+
OTHER_LDFLAGS = "-all_load";
21332124
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
21342125
PRODUCT_NAME = ObjectiveGit;
2126+
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/External/libgit2/include";
21352127
VERSIONING_SYSTEM = "apple-generic";
21362128
VERSION_INFO_PREFIX = "";
21372129
};
@@ -2183,6 +2175,10 @@
21832175
DYLIB_CURRENT_VERSION = 1;
21842176
FRAMEWORK_VERSION = A;
21852177
INFOPLIST_FILE = Info.plist;
2178+
LIBRARY_SEARCH_PATHS = (
2179+
"$(inherited)",
2180+
"$(PROJECT_DIR)/External/build/lib",
2181+
);
21862182
MODULEMAP_FILE = ObjectiveGit.modulemap;
21872183
OTHER_LDFLAGS = (
21882184
"-lgit2",

script/ios_build_functions.sh

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function setup_build_environment ()
99
# e.g. via brew. Xcode's Run Script phase doesn't seem to honor
1010
# ~/.MacOSX/environment.plist
1111
PATH="/usr/local/bin:/opt/boxen/homebrew/bin:$PATH"
12-
12+
1313
pushd "$SCRIPT_DIR/.." > /dev/null
1414
ROOT_PATH="$PWD"
1515
popd > /dev/null
@@ -22,7 +22,7 @@ function setup_build_environment ()
2222
MACOSX_DEPLOYMENT_TARGET=""
2323

2424
XCODE_MAJOR_VERSION=$(xcode_major_version)
25-
25+
2626
CAN_BUILD_64BIT="0"
2727

2828
# If IPHONEOS_DEPLOYMENT_TARGET has not been specified
@@ -32,7 +32,7 @@ function setup_build_environment ()
3232
then
3333
IPHONEOS_DEPLOYMENT_TARGET="6.0"
3434
fi
35-
35+
3636
# Determine if we can be building 64-bit binaries
3737
if [ "${XCODE_MAJOR_VERSION}" -ge "5" ] && [ $(echo ${IPHONEOS_DEPLOYMENT_TARGET} '>=' 6.0 | bc -l) == "1" ]
3838
then
@@ -46,12 +46,19 @@ function setup_build_environment ()
4646
# builds to be first
4747
ARCHS="x86_64 ${ARCHS} arm64"
4848
fi
49+
50+
# Setup a shared area for our build artifacts
51+
INSTALL_PATH="${ROOT_PATH}/External/build"
52+
mkdir -p "${INSTALL_PATH}"
53+
mkdir -p "${INSTALL_PATH}/log"
54+
mkdir -p "${INSTALL_PATH}/include"
55+
mkdir -p "${INSTALL_PATH}/lib/pkgconfig"
4956
}
5057

5158
function build_all_archs ()
5259
{
5360
setup_build_environment
54-
61+
5562
local setup=$1
5663
local build_arch=$2
5764
local finish_build=$3
@@ -81,10 +88,17 @@ function build_all_archs ()
8188

8289
SDKNAME="${PLATFORM}${SDKVERSION}"
8390
SDKROOT="$(ios_sdk_path ${SDKNAME})"
84-
91+
92+
LOG="${INSTALL_PATH}/log/${LIBRARY_NAME}-${ARCH}.log"
93+
[ -f "${LOG}" ] && rm "${LOG}"
94+
8595
echo "Building ${LIBRARY_NAME} for ${SDKNAME} ${ARCH}"
96+
echo "Build log can be found in ${LOG}"
8697
echo "Please stand by..."
8798

99+
ARCH_INSTALL_PATH="${INSTALL_PATH}/${SDKNAME}-${ARCH}.sdk"
100+
mkdir -p "${ARCH_INSTALL_PATH}"
101+
88102
# run the per arch build command
89103
eval $build_arch
90104
done

0 commit comments

Comments
 (0)