Skip to content

Commit 09cc984

Browse files
committed
Get the module working
The swift compiler is confused by the user header search paths in the git2/sys/* headers. This includes a second copy of the git2 headers so that the swift compiler will find them when included from these headers. It happens to still work with the modulemap.
1 parent 46fda7b commit 09cc984

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

module.map renamed to ObjectiveGit.modulemap

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
framework module ObjectiveGit {
22
umbrella header "ObjectiveGit.h"
33

4-
header "git2/annotated_commit.h"
54
header "git2/attr.h"
65
header "git2/blob.h"
76
header "git2/blame.h"
@@ -29,12 +28,10 @@ framework module ObjectiveGit {
2928
header "git2/odb.h"
3029
header "git2/odb_backend.h"
3130
header "git2/oid.h"
32-
header "git2/oidarray.h"
3331
header "git2/pack.h"
3432
header "git2/patch.h"
3533
header "git2/pathspec.h"
3634
header "git2/push.h"
37-
header "git2/rebase.h"
3835
header "git2/refdb.h"
3936
header "git2/reflog.h"
4037
header "git2/refs.h"
@@ -48,14 +45,26 @@ framework module ObjectiveGit {
4845
header "git2/signature.h"
4946
header "git2/stash.h"
5047
header "git2/status.h"
51-
header "git2/strarray.h"
5248
header "git2/submodule.h"
5349
header "git2/tag.h"
5450
header "git2/threads.h"
5551
header "git2/transport.h"
5652
header "git2/tree.h"
5753
header "git2/types.h"
5854
header "git2/version.h"
55+
header "git2/sys/commit.h"
56+
header "git2/sys/config.h"
57+
header "git2/sys/diff.h"
58+
header "git2/sys/filter.h"
59+
header "git2/sys/hashsig.h"
60+
header "git2/sys/index.h"
61+
header "git2/sys/mempack.h"
62+
header "git2/sys/odb_backend.h"
63+
header "git2/sys/refdb_backend.h"
64+
header "git2/sys/reflog.h"
65+
header "git2/sys/refs.h"
66+
header "git2/sys/repository.h"
67+
header "git2/sys/transport.h"
5968

6069
export *
6170
module * { export * }

ObjectiveGitFramework.xcodeproj/project.pbxproj

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
BDFAF9C4131C1845000508BC /* GTIndex.m in Sources */ = {isa = PBXBuildFile; fileRef = BDFAF9C2131C1845000508BC /* GTIndex.m */; };
176176
BDFAF9C9131C1868000508BC /* GTIndexEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = BDFAF9C7131C1868000508BC /* GTIndexEntry.h */; settings = {ATTRIBUTES = (Public, ); }; };
177177
BDFAF9CA131C1868000508BC /* GTIndexEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = BDFAF9C8131C1868000508BC /* GTIndexEntry.m */; };
178+
BEF7E4E01A3A47690035BB8E /* git2 in Copy git2 Headers again */ = {isa = PBXBuildFile; fileRef = 79262F0E13C697BE00A4B1EA /* git2 */; };
178179
D00F6816175D373C004DB9D6 /* GTReferenceSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = D00F6815175D373C004DB9D6 /* GTReferenceSpec.m */; };
179180
D015F7CA17F695E800AD5E1F /* GTRepository+Stashing.h in Headers */ = {isa = PBXBuildFile; fileRef = D015F7C817F695E800AD5E1F /* GTRepository+Stashing.h */; settings = {ATTRIBUTES = (Public, ); }; };
180181
D015F7CC17F695E800AD5E1F /* GTRepository+Stashing.m in Sources */ = {isa = PBXBuildFile; fileRef = D015F7C917F695E800AD5E1F /* GTRepository+Stashing.m */; };
@@ -365,6 +366,17 @@
365366
name = "Copy git2 Headers";
366367
runOnlyForDeploymentPostprocessing = 0;
367368
};
369+
BEF7E4DF1A3A47450035BB8E /* Copy git2 Headers again */ = {
370+
isa = PBXCopyFilesBuildPhase;
371+
buildActionMask = 2147483647;
372+
dstPath = Headers/git2/sys;
373+
dstSubfolderSpec = 1;
374+
files = (
375+
BEF7E4E01A3A47690035BB8E /* git2 in Copy git2 Headers again */,
376+
);
377+
name = "Copy git2 Headers again";
378+
runOnlyForDeploymentPostprocessing = 0;
379+
};
368380
/* End PBXCopyFilesBuildPhase section */
369381

370382
/* Begin PBXFileReference section */
@@ -451,7 +463,7 @@
451463
8870390A1975E3F2004118D7 /* GTDiffDeltaSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTDiffDeltaSpec.m; sourceTree = "<group>"; };
452464
88746CC217FA1C950005888A /* GTRepository+Committing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTRepository+Committing.h"; sourceTree = "<group>"; };
453465
88746CC317FA1C950005888A /* GTRepository+Committing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GTRepository+Committing.m"; sourceTree = "<group>"; };
454-
887B948D1A3A38130070D41D /* module.map */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = module.map; sourceTree = "<group>"; };
466+
887B948D1A3A38130070D41D /* ObjectiveGit.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = ObjectiveGit.modulemap; sourceTree = "<group>"; };
455467
887DAFF615CB1C8000F30D0D /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
456468
88948AC81779243600809CDA /* GTObjectDatabaseSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTObjectDatabaseSpec.m; sourceTree = "<group>"; };
457469
889923F919FF5DD40092A9A6 /* git2 */ = {isa = PBXFileReference; lastKnownFileType = folder; name = git2; path = External/libgit2/include/git2; sourceTree = "<group>"; };
@@ -607,7 +619,7 @@
607619
isa = PBXGroup;
608620
children = (
609621
BDD8AB01130F01AB00CB5D40 /* README.md */,
610-
887B948D1A3A38130070D41D /* module.map */,
622+
887B948D1A3A38130070D41D /* ObjectiveGit.modulemap */,
611623
BDE4C05E130EFE2C00851650 /* ObjectiveGit */,
612624
88F05A7516011E5400B7AD1D /* ObjectiveGitTests */,
613625
32C88DFF0371C24200C91783 /* Other Sources */,
@@ -1073,6 +1085,7 @@
10731085
8DC2EF520486A6940098B216 /* Resources */,
10741086
8DC2EF560486A6940098B216 /* Frameworks */,
10751087
79262F0F13C697BE00A4B1EA /* Copy git2 Headers */,
1088+
BEF7E4DF1A3A47450035BB8E /* Copy git2 Headers again */,
10761089
8DC2EF500486A6940098B216 /* Headers */,
10771090
);
10781091
buildRules = (
@@ -1427,11 +1440,12 @@
14271440
isa = XCBuildConfiguration;
14281441
baseConfigurationReference = D0D8186A174421EB00995A2E /* Mac-Framework.xcconfig */;
14291442
buildSettings = {
1443+
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
14301444
DYLIB_COMPATIBILITY_VERSION = 1;
14311445
DYLIB_CURRENT_VERSION = 1;
14321446
FRAMEWORK_VERSION = A;
14331447
INFOPLIST_FILE = Info.plist;
1434-
MODULEMAP_FILE = module.map;
1448+
MODULEMAP_FILE = ObjectiveGit.modulemap;
14351449
OTHER_LDFLAGS = (
14361450
"-lgit2",
14371451
"-force_load",
@@ -1449,11 +1463,12 @@
14491463
isa = XCBuildConfiguration;
14501464
baseConfigurationReference = D0D8186A174421EB00995A2E /* Mac-Framework.xcconfig */;
14511465
buildSettings = {
1466+
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
14521467
DYLIB_COMPATIBILITY_VERSION = 1;
14531468
DYLIB_CURRENT_VERSION = 1;
14541469
FRAMEWORK_VERSION = A;
14551470
INFOPLIST_FILE = Info.plist;
1456-
MODULEMAP_FILE = module.map;
1471+
MODULEMAP_FILE = ObjectiveGit.modulemap;
14571472
OTHER_LDFLAGS = (
14581473
"-lgit2",
14591474
"-force_load",
@@ -1631,11 +1646,12 @@
16311646
isa = XCBuildConfiguration;
16321647
baseConfigurationReference = D0D8186A174421EB00995A2E /* Mac-Framework.xcconfig */;
16331648
buildSettings = {
1649+
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
16341650
DYLIB_COMPATIBILITY_VERSION = 1;
16351651
DYLIB_CURRENT_VERSION = 1;
16361652
FRAMEWORK_VERSION = A;
16371653
INFOPLIST_FILE = Info.plist;
1638-
MODULEMAP_FILE = module.map;
1654+
MODULEMAP_FILE = ObjectiveGit.modulemap;
16391655
OTHER_LDFLAGS = (
16401656
"-lgit2",
16411657
"-force_load",
@@ -1847,11 +1863,12 @@
18471863
isa = XCBuildConfiguration;
18481864
baseConfigurationReference = D0D8186A174421EB00995A2E /* Mac-Framework.xcconfig */;
18491865
buildSettings = {
1866+
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
18501867
DYLIB_COMPATIBILITY_VERSION = 1;
18511868
DYLIB_CURRENT_VERSION = 1;
18521869
FRAMEWORK_VERSION = A;
18531870
INFOPLIST_FILE = Info.plist;
1854-
MODULEMAP_FILE = module.map;
1871+
MODULEMAP_FILE = ObjectiveGit.modulemap;
18551872
OTHER_LDFLAGS = (
18561873
"-lgit2",
18571874
"-force_load",

0 commit comments

Comments
 (0)