-
Notifications
You must be signed in to change notification settings - Fork 127
Fix building on Windows #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,11 +12,19 @@ | |
|
|
||
| import PackageDescription | ||
|
|
||
| let targets: [PackageDescription.Target] = [ | ||
| var windowsPlatform: [Platform] = [] | ||
| #if os(Windows) | ||
| windowsPlatform.append(.windows) | ||
| #endif | ||
|
|
||
| let targets: [Target] = [ | ||
| .target( | ||
| name: "SystemPackage", | ||
| dependencies: ["CSystem"], | ||
| path: "Sources/System", | ||
| cSettings: [ | ||
| .define("_CRT_SECURE_NO_WARNINGS", .when(platforms: windowsPlatform)), | ||
|
||
| ], | ||
| swiftSettings: [ | ||
| .define("SYSTEM_PACKAGE"), | ||
| .define("ENABLE_MOCKING", .when(configuration: .debug)) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that familiar with manifests. Why is conditional compilation needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 AFAIK this is used to comfort SwiftPM 5.3 because it doesn't recognize Windows. This workaround is introduced by @compnerd for other projects and I just use it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that this would be needed given the comment below.