Skip to content

Commit 76ab3de

Browse files
author
Aleksandar Vacic
committed
Another approach:
- remove CommonCrypto file(s) from the file system - added new aggregate target which conditionally builds CommonCrypto - link to that target in all 4 of our targets Per: https://stackoverflow.com/a/42852743/108859 re kylef#102
1 parent b7188dc commit 76ab3de

File tree

4 files changed

+124
-5
lines changed

4 files changed

+124
-5
lines changed

CommonCrypto/module.modulemap

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

CommonCrypto/shim.h

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

JWT.xcodeproj/project.pbxproj

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
objectVersion = 46;
77
objects = {
88

9+
/* Begin PBXAggregateTarget section */
10+
D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */ = {
11+
isa = PBXAggregateTarget;
12+
buildConfigurationList = D0A831672110E20A00DEA3E1 /* Build configuration list for PBXAggregateTarget "CommonCryptoModuleMap" */;
13+
buildPhases = (
14+
D0A8316A2110E23200DEA3E1 /* ShellScript */,
15+
);
16+
dependencies = (
17+
);
18+
name = CommonCryptoModuleMap;
19+
productName = CommonCryptoModuleMap;
20+
};
21+
/* End PBXAggregateTarget section */
22+
923
/* Begin PBXBuildFile section */
1024
271E10801F90253300B5033C /* JWA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 271E107F1F90253300B5033C /* JWA.swift */; };
1125
271E10811F90253300B5033C /* JWA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 271E107F1F90253300B5033C /* JWA.swift */; };
@@ -77,6 +91,34 @@
7791
remoteGlobalIDString = 279D639B1AD07FFF0024E2BC;
7892
remoteInfo = JWT;
7993
};
94+
D0A8316B2110E2A700DEA3E1 /* PBXContainerItemProxy */ = {
95+
isa = PBXContainerItemProxy;
96+
containerPortal = 279D63931AD07FFF0024E2BC /* Project object */;
97+
proxyType = 1;
98+
remoteGlobalIDString = D0A831662110E20A00DEA3E1;
99+
remoteInfo = CommonCryptoModuleMap;
100+
};
101+
D0A8316D2110E2AF00DEA3E1 /* PBXContainerItemProxy */ = {
102+
isa = PBXContainerItemProxy;
103+
containerPortal = 279D63931AD07FFF0024E2BC /* Project object */;
104+
proxyType = 1;
105+
remoteGlobalIDString = D0A831662110E20A00DEA3E1;
106+
remoteInfo = CommonCryptoModuleMap;
107+
};
108+
D0A8316F2110E2B500DEA3E1 /* PBXContainerItemProxy */ = {
109+
isa = PBXContainerItemProxy;
110+
containerPortal = 279D63931AD07FFF0024E2BC /* Project object */;
111+
proxyType = 1;
112+
remoteGlobalIDString = D0A831662110E20A00DEA3E1;
113+
remoteInfo = CommonCryptoModuleMap;
114+
};
115+
D0A831712110E2BC00DEA3E1 /* PBXContainerItemProxy */ = {
116+
isa = PBXContainerItemProxy;
117+
containerPortal = 279D63931AD07FFF0024E2BC /* Project object */;
118+
proxyType = 1;
119+
remoteGlobalIDString = D0A831662110E20A00DEA3E1;
120+
remoteInfo = CommonCryptoModuleMap;
121+
};
80122
/* End PBXContainerItemProxy section */
81123

82124
/* Begin PBXFileReference section */
@@ -308,6 +350,7 @@
308350
buildRules = (
309351
);
310352
dependencies = (
353+
D0A8316C2110E2A700DEA3E1 /* PBXTargetDependency */,
311354
);
312355
name = "JWT-OSX";
313356
productName = JWT;
@@ -344,6 +387,7 @@
344387
buildRules = (
345388
);
346389
dependencies = (
390+
D0A8316E2110E2AF00DEA3E1 /* PBXTargetDependency */,
347391
);
348392
name = "JWT-iOS";
349393
productName = JWT;
@@ -362,6 +406,7 @@
362406
buildRules = (
363407
);
364408
dependencies = (
409+
D0A831702110E2B500DEA3E1 /* PBXTargetDependency */,
365410
);
366411
name = "JWT-tvOS";
367412
productName = JWT;
@@ -380,6 +425,7 @@
380425
buildRules = (
381426
);
382427
dependencies = (
428+
D0A831722110E2BC00DEA3E1 /* PBXTargetDependency */,
383429
);
384430
name = "JWT-watchOS";
385431
productName = JWT;
@@ -403,6 +449,10 @@
403449
279D63A61AD07FFF0024E2BC = {
404450
CreatedOnToolsVersion = 6.2;
405451
};
452+
D0A831662110E20A00DEA3E1 = {
453+
CreatedOnToolsVersion = 10.0;
454+
ProvisioningStyle = Automatic;
455+
};
406456
};
407457
};
408458
buildConfigurationList = 279D63961AD07FFF0024E2BC /* Build configuration list for PBXProject "JWT" */;
@@ -422,6 +472,7 @@
422472
CD9B62251C7753EC005D4844 /* JWT-tvOS */,
423473
CD9B62371C7753FB005D4844 /* JWT-watchOS */,
424474
279D63A61AD07FFF0024E2BC /* JWTTests */,
475+
D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */,
425476
);
426477
};
427478
/* End PBXProject section */
@@ -464,6 +515,26 @@
464515
};
465516
/* End PBXResourcesBuildPhase section */
466517

518+
/* Begin PBXShellScriptBuildPhase section */
519+
D0A8316A2110E23200DEA3E1 /* ShellScript */ = {
520+
isa = PBXShellScriptBuildPhase;
521+
buildActionMask = 2147483647;
522+
files = (
523+
);
524+
inputFileListPaths = (
525+
);
526+
inputPaths = (
527+
);
528+
outputFileListPaths = (
529+
);
530+
outputPaths = (
531+
);
532+
runOnlyForDeploymentPostprocessing = 0;
533+
shellPath = /bin/sh;
534+
shellScript = "COMMON_CRYPTO_DIR=\"${SDKROOT}/usr/include/CommonCrypto\"\nif [ -f \"${COMMON_CRYPTO_DIR}/module.modulemap\" ]\nthen\necho \"CommonCrypto already exists, skipping\"\nelse\n# This if-statement means we'll only run the main script if the CommonCryptoModuleMap directory doesn't exist\n# Because otherwise the rest of the script causes a full recompile for anything where CommonCrypto is a dependency\n# Do a \"Clean Build Folder\" to remove this directory and trigger the rest of the script to run\nif [ -d \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap\" ]; then\necho \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap directory already exists, so skipping the rest of the script.\"\nexit 0\nfi\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap\"\ncat <<EOF > \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap/module.modulemap\"\nmodule CommonCrypto [system] {\nheader \"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\"\nexport *\n}\nEOF\nfi\n";
535+
};
536+
/* End PBXShellScriptBuildPhase section */
537+
467538
/* Begin PBXSourcesBuildPhase section */
468539
279D63971AD07FFF0024E2BC /* Sources */ = {
469540
isa = PBXSourcesBuildPhase;
@@ -563,6 +634,26 @@
563634
target = 279D639B1AD07FFF0024E2BC /* JWT-OSX */;
564635
targetProxy = 279D63A91AD07FFF0024E2BC /* PBXContainerItemProxy */;
565636
};
637+
D0A8316C2110E2A700DEA3E1 /* PBXTargetDependency */ = {
638+
isa = PBXTargetDependency;
639+
target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */;
640+
targetProxy = D0A8316B2110E2A700DEA3E1 /* PBXContainerItemProxy */;
641+
};
642+
D0A8316E2110E2AF00DEA3E1 /* PBXTargetDependency */ = {
643+
isa = PBXTargetDependency;
644+
target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */;
645+
targetProxy = D0A8316D2110E2AF00DEA3E1 /* PBXContainerItemProxy */;
646+
};
647+
D0A831702110E2B500DEA3E1 /* PBXTargetDependency */ = {
648+
isa = PBXTargetDependency;
649+
target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */;
650+
targetProxy = D0A8316F2110E2B500DEA3E1 /* PBXContainerItemProxy */;
651+
};
652+
D0A831722110E2BC00DEA3E1 /* PBXTargetDependency */ = {
653+
isa = PBXTargetDependency;
654+
target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */;
655+
targetProxy = D0A831712110E2BC00DEA3E1 /* PBXContainerItemProxy */;
656+
};
566657
/* End PBXTargetDependency section */
567658

568659
/* Begin XCBuildConfiguration section */
@@ -858,6 +949,22 @@
858949
};
859950
name = Release;
860951
};
952+
D0A831682110E20A00DEA3E1 /* Debug */ = {
953+
isa = XCBuildConfiguration;
954+
buildSettings = {
955+
CODE_SIGN_STYLE = Automatic;
956+
PRODUCT_NAME = "$(TARGET_NAME)";
957+
};
958+
name = Debug;
959+
};
960+
D0A831692110E20A00DEA3E1 /* Release */ = {
961+
isa = XCBuildConfiguration;
962+
buildSettings = {
963+
CODE_SIGN_STYLE = Automatic;
964+
PRODUCT_NAME = "$(TARGET_NAME)";
965+
};
966+
name = Release;
967+
};
861968
/* End XCBuildConfiguration section */
862969

863970
/* Begin XCConfigurationList section */
@@ -915,6 +1022,15 @@
9151022
defaultConfigurationIsVisible = 0;
9161023
defaultConfigurationName = Release;
9171024
};
1025+
D0A831672110E20A00DEA3E1 /* Build configuration list for PBXAggregateTarget "CommonCryptoModuleMap" */ = {
1026+
isa = XCConfigurationList;
1027+
buildConfigurations = (
1028+
D0A831682110E20A00DEA3E1 /* Debug */,
1029+
D0A831692110E20A00DEA3E1 /* Release */,
1030+
);
1031+
defaultConfigurationIsVisible = 0;
1032+
defaultConfigurationName = Release;
1033+
};
9181034
/* End XCConfigurationList section */
9191035
};
9201036
rootObject = 279D63931AD07FFF0024E2BC /* Project object */;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)