Skip to content

Commit dd32be7

Browse files
authored
Merge pull request swiftlang#1008 from daveinglis/new_static_archive_type
Create a common static archive product-type for swiftPM to use
2 parents 641b615 + 8f37117 commit dd32be7

6 files changed

Lines changed: 27 additions & 22 deletions

File tree

Sources/SWBApplePlatform/Specs/DarwinProductTypes.xcspec

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -474,15 +474,4 @@
474474
com.apple.package-type.mach-o-executable
475475
);
476476
},
477-
{
478-
_Domain = darwin;
479-
Type = ProductType;
480-
Identifier = org.swift.product-type.common.object;
481-
BasedOn = com.apple.product-type.objfile;
482-
Class = XCStandaloneExecutableProductType;
483-
Description = "Object File";
484-
IconNamePrefix = "TargetPlugin";
485-
DefaultTargetName = "Object File";
486-
},
487-
488477
)

Sources/SWBGenericUnixPlatform/Specs/Unix.xcspec

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,6 @@
8181
BasedOn = com.apple.product-type.framework;
8282
},
8383

84-
{
85-
Domain = generic-unix;
86-
Type = ProductType;
87-
Identifier = org.swift.product-type.common.object;
88-
BasedOn = com.apple.product-type.objfile;
89-
Class = XCStandaloneExecutableProductType;
90-
Description = "Object File";
91-
IconNamePrefix = "TargetPlugin";
92-
DefaultTargetName = "Object File";
93-
},
9484
{
9585
Domain = generic-unix;
9686
Type = FileType;

Sources/SWBUniversalPlatform/Specs/ProductTypes.xcspec

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,23 @@
205205
);
206206
},
207207

208+
{
209+
Type = ProductType;
210+
Identifier = org.swift.product-type.common.object;
211+
BasedOn = com.apple.product-type.objfile;
212+
Name = "Mappable Common Object Type";
213+
Description = "This type should be used as the top level product type for object files as it may map to different types on different platforms";
214+
},
215+
216+
{
217+
Type = ProductType;
218+
Identifier = org.swift.product-type.library.static;
219+
BasedOn = com.apple.product-type.objfile;
220+
Name = "Mappable Common Static Library Type";
221+
Description = "This type should be used as the top level product type for static libraries as it may map to different types on different platforms";
222+
},
223+
224+
208225
//
209226
// Wrapper product types
210227
//

Sources/SWBWindowsPlatform/Specs/Windows.xcspec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@
114114
BasedOn = com.apple.product-type.library.static;
115115
},
116116

117+
{
118+
Domain = windows;
119+
Type = ProductType;
120+
Identifier = org.swift.product-type.library.static;
121+
BasedOn = com.apple.product-type.library.static;
122+
},
123+
124+
117125
{
118126
Domain = windows;
119127
Type = FileType;

Sources/SWBWindowsPlatform/Specs/WindowsCompile.xcspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
Name = __WINDOWS_STATIC_FLAG;
103103
Type = Bool;
104104
DefaultValue = YES;
105-
Condition = "$(PRODUCT_TYPE) == 'com.apple.product-type.library.static' || $(PRODUCT_TYPE) == 'org.swift.product-type.common.object'";
105+
Condition = "$(PRODUCT_TYPE) == 'com.apple.product-type.library.static' || $(PRODUCT_TYPE) == 'org.swift.product-type.library.static' || $(PRODUCT_TYPE) == 'org.swift.product-type.common.object'";
106106
CommandLineArgs = ("-static");
107107
}
108108
);

Sources/SwiftBuild/ProjectModel/Targets.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ extension ProjectModel {
310310
public enum ProductType: String, Sendable, Codable, CaseIterable {
311311
case application = "com.apple.product-type.application"
312312
case staticArchive = "com.apple.product-type.library.static"
313+
case commonStaticArchive = "org.swift.product-type.library.static"
313314
case commonObject = "org.swift.product-type.common.object"
314315
case objectFile = "com.apple.product-type.objfile"
315316
case dynamicLibrary = "com.apple.product-type.library.dynamic"

0 commit comments

Comments
 (0)