Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class ObjectLibraryAssemblerTaskAction: TaskAction {
_ = try await options.inputs.concurrentMap(maximumParallelism: 10) { input in
try executionDelegate.fs.copy(input, to: options.output.join(input.basename))
}
let args = options.inputs.map { $0.strWithPosixSlashes }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! wonder if we should add a test to check the response file contents is correct here

let args = options.inputs.map { options.output.join($0.basename).strWithPosixSlashes }
try executionDelegate.fs.write(options.output.join("args.resp"), contents: ByteString(encodingAsUTF8: ResponseFiles.responseFileContents(args: args, format: options.linkerResponseFileFormat)))
return .succeeded
} catch {
Expand Down
7 changes: 1 addition & 6 deletions Sources/SWBWindowsPlatform/Specs/Windows.xcspec
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@
Domain = windows;
Type = ProductType;
Identifier = org.swift.product-type.common.object;
BasedOn = org.swift.product-type.library.object;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this left over from debugging or is it needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So linking with static libraries seems to be much better than using the objlib artifacts, as you don’t get the linker warnings on duplicate symbols

Class = XCStandaloneExecutableProductType;
Name = "Object Library";
Description = "Object library";
IconNamePrefix = "TargetLibrary";
DefaultTargetName = "Object Library";
BasedOn = com.apple.product-type.library.static;
},
)
2 changes: 1 addition & 1 deletion Sources/SWBWindowsPlatform/Specs/WindowsCompile.xcspec
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
Name = __WINDOWS_STATIC_FLAG;
Type = Bool;
DefaultValue = YES;
Condition = "$(PRODUCT_TYPE) == 'com.apple.product-type.library.static'";
Condition = "$(PRODUCT_TYPE) == 'com.apple.product-type.library.static' || $(PRODUCT_TYPE) == 'org.swift.product-type.common.object'";
CommandLineArgs = ("-static");
}
);
Expand Down
Loading