Skip to content

Commit 351b88d

Browse files
committed
configure modulemap sepately.
1 parent 0e8283c commit 351b88d

File tree

16 files changed

+309
-74
lines changed

16 files changed

+309
-74
lines changed

.DS_Store

0 Bytes
Binary file not shown.

MixLibraryOne/MixLibOne.xcconfig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
// https://help.apple.com/xcode/#/dev745c5c974
1111

1212

13-
// search the objecitve c headers & swift generated header files from "User header search path"
14-
USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/MixLibraryOne $(SRCROOT)/include
13+
// Product module name should be same inside modulemap file to map the respective headers
14+
PRODUCT_MODULE_NAME = MixLibraryOne
1515

1616
// allow modularisation to that static library
1717
DEFINES_MODULE = YES
1818

1919
// refer the modulemap file from this place
20-
MODULEMAP_FILE = $(SRCROOT)/MixLibraryOne/module.modulemap
20+
MODULEMAP_FILE = $(SRCROOT)/Modules/module.modulemap
2121

22-
// Product module name should be same inside modulemap file to map the respective headers
23-
PRODUCT_MODULE_NAME = MixLibraryOne
22+
// search the objecitve c headers & swift generated header files from "User header search path"
23+
USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/Modules $(SRCROOT)/include
2424

2525
// define the objective c interface for swift files
2626
SWIFT_OBJC_INTERFACE_HEADER_NAME = MixLibOne-Swift.h

MixLibraryOne/module.modulemap

Lines changed: 0 additions & 9 deletions
This file was deleted.

MixLibraryThree/MixLibThree.xcconfig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
// https://help.apple.com/xcode/#/dev745c5c974
1111

1212

13+
// Product module name should be same inside modulemap file to map the respective headers
14+
PRODUCT_MODULE_NAME = MixLibThree
15+
16+
1317
// search the objecitve c headers & swift generated header files from "User header search path"
1418
// we can skip "copy files" step in "build phases" by providing the proper location of dependent (if both target belongs to same project) of user header search path
15-
USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/MixLibraryOne $(SRCROOT)/include
19+
USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/Modules $(SRCROOT)/include
1620

1721
// allow modularisation to that static library
1822
DEFINES_MODULE = YES
1923

2024
// refer the modulemap file from Mix LibraryOne - // TODO: we can separate this out from MixLibraryOne
21-
MODULEMAP_FILE = $(SRCROOT)/MixLibraryOne/module.modulemap
22-
23-
24-
// Product module name should be same inside modulemap file to map the respective headers
25-
PRODUCT_MODULE_NAME = MixLibThree
25+
MODULEMAP_FILE = $(SRCROOT)/Modules/module.modulemap

MixLibraryTwo/MixLibTwo.xcconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// MixLibTwo.xcconfig
3+
// MixLibraryTwo
4+
//
5+
// Created by Ashis Laha on 30/12/19.
6+
// Copyright © 2019 Ashis Laha. All rights reserved.
7+
//
8+
9+
// Configuration settings file format documentation can be found at:
10+
// https://help.apple.com/xcode/#/dev745c5c974
11+
12+
// search the objecitve c headers & swift generated header files from "User header search path"
13+
USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/Modules $(SRCROOT)/include
14+

MixLibraryTwo/MixLibraryTwoObjCFileA.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ -(void) testInMixLibraryTwo {
3131
// use of objective c classes
3232
MixLibOneObjcFileA *obj = [[MixLibOneObjcFileA alloc] init];
3333
[obj test];
34-
34+
3535
// use of swift classes
3636
MixLibOneSwiftOne *obj2 = [[MixLibOneSwiftOne alloc] init];
3737
[obj2 test];
38-
38+
3939
// use objc class of MixLibraryThree
4040
MixLibraryThree *obj3 = [[MixLibraryThree alloc] init];
4141
[obj3 exposedMethod];

Modules/module.modulemap

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module ObjectiveLibraryOne {
2+
umbrella header "../ObjectiveLibraryOne/ObjectiveLibraryOne.h"
3+
export *
4+
5+
// Define a Model module, which include an example model object class.
6+
explicit module Model {
7+
header "../ObjectiveLibraryOne/ObjCOneFileA.h"
8+
}
9+
}
10+
11+
module MixLibraryOne {
12+
header "../MixLibraryOne/MixLibOneObjcFileA.h"
13+
requires ios
14+
}
15+
16+
module MixLibThree {
17+
header "../MixLibraryThree/MixLibraryThree.h"
18+
requires ios
19+
}

ObjectiveLibraryOne/ObjectiveCLibraryOne.xcconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
// https://help.apple.com/xcode/#/dev745c5c974
1111

1212
DEFINE_MODULES = YES
13-
14-
//MODULEMAP_FILE = $(SOURCE_ROOT)/$(PRODUCT)
13+
MODULEMAP_FILE = $(SRCROOT)/Modules/module.modulemap

ObjectiveLibraryOne/module.modulemap

Lines changed: 0 additions & 9 deletions
This file was deleted.

PlayWithLibraries.xcodeproj/project.pbxproj

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
551EF866238AD68900982035 /* ObjCTwoFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 551EF85C238AD2A400982035 /* ObjCTwoFile.h */; };
2121
551EF86E238C1FED00982035 /* ObjCAppTarget.m in Sources */ = {isa = PBXBuildFile; fileRef = 551EF86D238C1FED00982035 /* ObjCAppTarget.m */; };
2222
551EF871238C250F00982035 /* SwiftAppTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 551EF870238C250F00982035 /* SwiftAppTarget.swift */; };
23+
552BBE5123BB3781005EDE88 /* libMixLibraryTwo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55929AEE23AF9E210043C6A9 /* libMixLibraryTwo.a */; };
2324
553B378C23B5D6D2008CE1C0 /* MixLibOneSwiftOne.swift in Sources */ = {isa = PBXBuildFile; fileRef = 558AC0D023ACA7EC005FD5B7 /* MixLibOneSwiftOne.swift */; };
2425
55443863238FEDD500368F89 /* ObjectiveLibraryOne.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 551EF85F238AD37500982035 /* ObjectiveLibraryOne.h */; };
2526
55443864238FEDE300368F89 /* ObjCOneFileA.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 551EF859238AD21200982035 /* ObjCOneFileA.h */; };
@@ -42,10 +43,16 @@
4243
559724BB239E9D3700688A06 /* libSwiftStaticLibraryTwo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 559724A9239E8BD400688A06 /* libSwiftStaticLibraryTwo.a */; };
4344
55990FA1238E264C002059F8 /* libObjectiveLibraryOne.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 551EF84D238AD07800982035 /* libObjectiveLibraryOne.a */; };
4445
55990FA2238E2652002059F8 /* libSwiftLibraryOne.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 551EF83A238AAEEC00982035 /* libSwiftLibraryOne.a */; };
45-
55990FA5238E2B72002059F8 /* module.modulemap in CopyFiles */ = {isa = PBXBuildFile; fileRef = 55990FA3238E2A1B002059F8 /* module.modulemap */; };
4646
/* End PBXBuildFile section */
4747

4848
/* Begin PBXContainerItemProxy section */
49+
552BBE4F23BB377A005EDE88 /* PBXContainerItemProxy */ = {
50+
isa = PBXContainerItemProxy;
51+
containerPortal = 551EF7FA238AA57000982035 /* Project object */;
52+
proxyType = 1;
53+
remoteGlobalIDString = 55929AED23AF9E210043C6A9;
54+
remoteInfo = MixLibraryTwo;
55+
};
4956
555EA18123A5027F003227E8 /* PBXContainerItemProxy */ = {
5057
isa = PBXContainerItemProxy;
5158
containerPortal = 551EF7FA238AA57000982035 /* Project object */;
@@ -187,7 +194,6 @@
187194
files = (
188195
55443864238FEDE300368F89 /* ObjCOneFileA.h in CopyFiles */,
189196
55443863238FEDD500368F89 /* ObjectiveLibraryOne.h in CopyFiles */,
190-
55990FA5238E2B72002059F8 /* module.modulemap in CopyFiles */,
191197
);
192198
runOnlyForDeploymentPostprocessing = 0;
193199
};
@@ -229,6 +235,7 @@
229235
5586F3EE23B8ED9000AFD5E4 /* MixLibraryTwoObjCFileA.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MixLibraryTwoObjCFileA.h; sourceTree = "<group>"; };
230236
5586F3EF23B8ED9000AFD5E4 /* MixLibraryTwoObjCFileA.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MixLibraryTwoObjCFileA.m; sourceTree = "<group>"; };
231237
5586F3F323B9A8C900AFD5E4 /* MixLibThree.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = MixLibThree.xcconfig; sourceTree = "<group>"; };
238+
5586F3F823B9DDAD00AFD5E4 /* MixLibTwo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = MixLibTwo.xcconfig; sourceTree = "<group>"; };
232239
558AC0C023AC6142005FD5B7 /* libMixLibraryOne.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMixLibraryOne.a; sourceTree = BUILT_PRODUCTS_DIR; };
233240
558AC0CA23AC7D19005FD5B7 /* MixLibOne.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = MixLibOne.xcconfig; sourceTree = "<group>"; };
234241
558AC0CB23AC7DA8005FD5B7 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
@@ -242,14 +249,14 @@
242249
55929AFC23B055840043C6A9 /* MixLibraryThree.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MixLibraryThree.m; sourceTree = "<group>"; };
243250
559724A9239E8BD400688A06 /* libSwiftStaticLibraryTwo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSwiftStaticLibraryTwo.a; sourceTree = BUILT_PRODUCTS_DIR; };
244251
559724B0239E8C1300688A06 /* SwiftStaticLibraryTwoFileA.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftStaticLibraryTwoFileA.swift; sourceTree = "<group>"; };
245-
55990FA3238E2A1B002059F8 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
246252
/* End PBXFileReference section */
247253

248254
/* Begin PBXFrameworksBuildPhase section */
249255
551EF7FF238AA57000982035 /* Frameworks */ = {
250256
isa = PBXFrameworksBuildPhase;
251257
buildActionMask = 2147483647;
252258
files = (
259+
552BBE5123BB3781005EDE88 /* libMixLibraryTwo.a in Frameworks */,
253260
559724BB239E9D3700688A06 /* libSwiftStaticLibraryTwo.a in Frameworks */,
254261
55990FA2238E2652002059F8 /* libSwiftLibraryOne.a in Frameworks */,
255262
55990FA1238E264C002059F8 /* libObjectiveLibraryOne.a in Frameworks */,
@@ -291,13 +298,6 @@
291298
);
292299
runOnlyForDeploymentPostprocessing = 0;
293300
};
294-
558AC0BD23AC6142005FD5B7 /* Frameworks */ = {
295-
isa = PBXFrameworksBuildPhase;
296-
buildActionMask = 2147483647;
297-
files = (
298-
);
299-
runOnlyForDeploymentPostprocessing = 0;
300-
};
301301
559724A6239E8BD400688A06 /* Frameworks */ = {
302302
isa = PBXFrameworksBuildPhase;
303303
buildActionMask = 2147483647;
@@ -312,6 +312,7 @@
312312
551EF7F9238AA57000982035 = {
313313
isa = PBXGroup;
314314
children = (
315+
552BBE4E23BB1DE5005EDE88 /* Modules */,
315316
551EF804238AA57100982035 /* PlayWithLibraries */,
316317
551EF83B238AAEEC00982035 /* SwiftLibraryOne */,
317318
551EF84E238AD07800982035 /* ObjectiveLibraryOne */,
@@ -383,7 +384,6 @@
383384
551EF85D238AD2A400982035 /* ObjCTwoFile.m */,
384385
551EF85F238AD37500982035 /* ObjectiveLibraryOne.h */,
385386
551EF860238AD4B200982035 /* ObjectiveCLibraryOne.xcconfig */,
386-
55990FA3238E2A1B002059F8 /* module.modulemap */,
387387
);
388388
path = ObjectiveLibraryOne;
389389
sourceTree = "<group>";
@@ -418,6 +418,14 @@
418418
path = Swift;
419419
sourceTree = "<group>";
420420
};
421+
552BBE4E23BB1DE5005EDE88 /* Modules */ = {
422+
isa = PBXGroup;
423+
children = (
424+
558AC0CB23AC7DA8005FD5B7 /* module.modulemap */,
425+
);
426+
path = Modules;
427+
sourceTree = "<group>";
428+
};
421429
555EA17923A50257003227E8 /* ObjCLibraryTwo */ = {
422430
isa = PBXGroup;
423431
children = (
@@ -456,7 +464,6 @@
456464
isa = PBXGroup;
457465
children = (
458466
558AC0CA23AC7D19005FD5B7 /* MixLibOne.xcconfig */,
459-
558AC0CB23AC7DA8005FD5B7 /* module.modulemap */,
460467
558AC0D023ACA7EC005FD5B7 /* MixLibOneSwiftOne.swift */,
461468
558AC0CD23ACA4C0005FD5B7 /* MixLibOneObjcFileA.h */,
462469
558AC0CE23ACA4C0005FD5B7 /* MixLibOneObjcFileA.m */,
@@ -470,6 +477,7 @@
470477
55929AF023AF9E210043C6A9 /* MixLibraryTwo.swift */,
471478
5586F3EE23B8ED9000AFD5E4 /* MixLibraryTwoObjCFileA.h */,
472479
5586F3EF23B8ED9000AFD5E4 /* MixLibraryTwoObjCFileA.m */,
480+
5586F3F823B9DDAD00AFD5E4 /* MixLibTwo.xcconfig */,
473481
);
474482
path = MixLibraryTwo;
475483
sourceTree = "<group>";
@@ -527,6 +535,7 @@
527535
buildRules = (
528536
);
529537
dependencies = (
538+
552BBE5023BB377A005EDE88 /* PBXTargetDependency */,
530539
559724BA239E9D2300688A06 /* PBXTargetDependency */,
531540
55990FA0238E263F002059F8 /* PBXTargetDependency */,
532541
55990F9E238E263B002059F8 /* PBXTargetDependency */,
@@ -647,9 +656,8 @@
647656
isa = PBXNativeTarget;
648657
buildConfigurationList = 558AC0C823AC6142005FD5B7 /* Build configuration list for PBXNativeTarget "MixLibraryOne" */;
649658
buildPhases = (
650-
558AC0BE23AC6142005FD5B7 /* CopyFiles */,
651659
558AC0BC23AC6142005FD5B7 /* Sources */,
652-
558AC0BD23AC6142005FD5B7 /* Frameworks */,
660+
558AC0BE23AC6142005FD5B7 /* CopyFiles */,
653661
5586F3F223B8FA1D00AFD5E4 /* ShellScript */,
654662
);
655663
buildRules = (
@@ -681,8 +689,8 @@
681689
isa = PBXNativeTarget;
682690
buildConfigurationList = 55929AFF23B055840043C6A9 /* Build configuration list for PBXNativeTarget "MixLibraryThree" */;
683691
buildPhases = (
684-
55929AF723B055840043C6A9 /* CopyFiles */,
685692
55929AF523B055840043C6A9 /* Sources */,
693+
55929AF723B055840043C6A9 /* CopyFiles */,
686694
);
687695
buildRules = (
688696
);
@@ -785,8 +793,8 @@
785793
555EA19123A52958003227E8 /* SwiftLibraryFour */,
786794
555EA19F23A52CE5003227E8 /* ObjCLibraryFour */,
787795
558AC0BF23AC6142005FD5B7 /* MixLibraryOne */,
788-
55929AED23AF9E210043C6A9 /* MixLibraryTwo */,
789796
55929AF823B055840043C6A9 /* MixLibraryThree */,
797+
55929AED23AF9E210043C6A9 /* MixLibraryTwo */,
790798
);
791799
};
792800
/* End PBXProject section */
@@ -992,6 +1000,11 @@
9921000
/* End PBXSourcesBuildPhase section */
9931001

9941002
/* Begin PBXTargetDependency section */
1003+
552BBE5023BB377A005EDE88 /* PBXTargetDependency */ = {
1004+
isa = PBXTargetDependency;
1005+
target = 55929AED23AF9E210043C6A9 /* MixLibraryTwo */;
1006+
targetProxy = 552BBE4F23BB377A005EDE88 /* PBXContainerItemProxy */;
1007+
};
9951008
555EA18223A5027F003227E8 /* PBXTargetDependency */ = {
9961009
isa = PBXTargetDependency;
9971010
target = 551EF84C238AD07800982035 /* ObjectiveLibraryOne */;
@@ -1258,7 +1271,7 @@
12581271
"@executable_path/Frameworks",
12591272
"@loader_path/Frameworks",
12601273
);
1261-
MODULEMAP_FILE = "$(SRCROOT)/ObjectiveLibraryOne/module.modulemap";
1274+
MODULEMAP_FILE = "";
12621275
OTHER_LDFLAGS = "-ObjC";
12631276
PRODUCT_NAME = "$(TARGET_NAME)";
12641277
SKIP_INSTALL = YES;
@@ -1281,7 +1294,7 @@
12811294
"@executable_path/Frameworks",
12821295
"@loader_path/Frameworks",
12831296
);
1284-
MODULEMAP_FILE = "$(SRCROOT)/ObjectiveLibraryOne/module.modulemap";
1297+
MODULEMAP_FILE = "";
12851298
OTHER_LDFLAGS = "-ObjC";
12861299
PRODUCT_NAME = "$(TARGET_NAME)";
12871300
SKIP_INSTALL = YES;
@@ -1425,10 +1438,10 @@
14251438
};
14261439
55929AF223AF9E210043C6A9 /* Debug */ = {
14271440
isa = XCBuildConfiguration;
1441+
baseConfigurationReference = 5586F3F823B9DDAD00AFD5E4 /* MixLibTwo.xcconfig */;
14281442
buildSettings = {
14291443
CLANG_ENABLE_MODULES = YES;
14301444
CODE_SIGN_STYLE = Automatic;
1431-
HEADER_SEARCH_PATHS = "${SRCROOT}/include/";
14321445
LD_RUNPATH_SEARCH_PATHS = (
14331446
"$(inherited)",
14341447
"@executable_path/Frameworks",
@@ -1440,20 +1453,15 @@
14401453
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
14411454
SWIFT_VERSION = 5.0;
14421455
TARGETED_DEVICE_FAMILY = "1,2";
1443-
USER_HEADER_SEARCH_PATHS = (
1444-
"$(inherited)",
1445-
"$(SRCROOT)/MixLibraryOne",
1446-
"$(SRCROOT)/MixLibraryThree",
1447-
);
14481456
};
14491457
name = Debug;
14501458
};
14511459
55929AF323AF9E210043C6A9 /* Release */ = {
14521460
isa = XCBuildConfiguration;
1461+
baseConfigurationReference = 5586F3F823B9DDAD00AFD5E4 /* MixLibTwo.xcconfig */;
14531462
buildSettings = {
14541463
CLANG_ENABLE_MODULES = YES;
14551464
CODE_SIGN_STYLE = Automatic;
1456-
HEADER_SEARCH_PATHS = "${SRCROOT}/include/";
14571465
LD_RUNPATH_SEARCH_PATHS = (
14581466
"$(inherited)",
14591467
"@executable_path/Frameworks",
@@ -1464,11 +1472,6 @@
14641472
SKIP_INSTALL = YES;
14651473
SWIFT_VERSION = 5.0;
14661474
TARGETED_DEVICE_FAMILY = "1,2";
1467-
USER_HEADER_SEARCH_PATHS = (
1468-
"$(inherited)",
1469-
"$(SRCROOT)/MixLibraryOne",
1470-
"$(SRCROOT)/MixLibraryThree",
1471-
);
14721475
};
14731476
name = Release;
14741477
};
@@ -1502,7 +1505,10 @@
15021505
CLANG_ENABLE_MODULES = YES;
15031506
CODE_SIGN_STYLE = Automatic;
15041507
DEFINES_MODULE = NO;
1505-
HEADER_SEARCH_PATHS = "";
1508+
HEADER_SEARCH_PATHS = (
1509+
"$(SRCROOT)/Modules",
1510+
"$(inherited)",
1511+
);
15061512
LD_RUNPATH_SEARCH_PATHS = (
15071513
"$(inherited)",
15081514
"@executable_path/Frameworks",
@@ -1523,7 +1529,10 @@
15231529
CLANG_ENABLE_MODULES = YES;
15241530
CODE_SIGN_STYLE = Automatic;
15251531
DEFINES_MODULE = NO;
1526-
HEADER_SEARCH_PATHS = "";
1532+
HEADER_SEARCH_PATHS = (
1533+
"$(SRCROOT)/Modules",
1534+
"$(inherited)",
1535+
);
15271536
LD_RUNPATH_SEARCH_PATHS = (
15281537
"$(inherited)",
15291538
"@executable_path/Frameworks",

0 commit comments

Comments
 (0)