-
Notifications
You must be signed in to change notification settings - Fork 199
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
Add support for building on Windows using SwiftPM #930
Conversation
| @@ -213,6 +221,9 @@ let package = Package( | |||
| .headerSearchPath(".."), | |||
| .headerSearchPath("../include"), | |||
| .headerSearchPath("../../googletest/include"), | |||
| ], | |||
| linkerSettings: [ | |||
| .linkedLibrary("swiftCore", .when(platforms: [.windows])), // for swift_addNewDSOImage | |||
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.
Have to add this otherwise I get linker errors about "missing symbol swift_addNewDSOImage" -- @compnerd any chance you know why this is an issue on Windows (and WebAssembly) in particular?
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.
It is because you are using swiftc as the linker driver. This will add in the swift registrar (swiftrt.obj or swiftrt.o) which requires that you overlink against swiftCore. I think that we want to build sqlite statically and not as a DLL.
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.
Ah, got it. I think in the longer term we probably should change the build system to use swift as the linker driver only if there's any Swift sources built in the target, otherwise clang/clang++?
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.
Yes, that would make sense. We could also use -nostdlib as a flag for the driver to exclude the registrar and the runtime.
|
@swift-ci please test |
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
|
@swift-ci please test |
|
The current round of CI failures should resolve once the new repo is added to update-checkout and related configs |
This is for swiftlang/swift-llbuild#930, which adds swift-toolchain-sqlite as a new dependency to SwiftPM to better support Windows and other platforms.
Opened swiftlang/swift#75743 for that |
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.
LGTM once CI is configured to check everything out
This is for swiftlang/swift-llbuild#930, which adds swift-toolchain-sqlite as a new dependency to SwiftPM to better support Windows and other platforms.
This adds a dependency on the new swift-toolchain-sqlite package, which allows llbuild to build using `swift build` on Windows (including tests) without any additional flags or preinstalled dependencies. rdar://133338086
…5743) This is for swiftlang/swift-llbuild#930, which adds swift-toolchain-sqlite as a new dependency to SwiftPM to better support Windows and other platforms.
|
@swift-ci please smoke test |
|
@swift-ci please test Windows |
1 similar comment
|
@swift-ci please test Windows |
| @@ -233,6 +242,16 @@ let package = Package( | |||
| cxxLanguageStandard: .cxx14 | |||
| ) | |||
|
|
|||
| if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { | |||
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.
not sure if this is gated by a tools version thats too old, but I think you should be able to use Context.environment instead of pulling in Foundation
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.
Didn't know that existed! I guess it's been there since Swift 5.6. But we should probably update this systematically across all apple/swiftlang repos, it appears in a lot of places.
This adds a dependency on the new swift-toolchain-sqlite package, which allows llbuild to build using
swift buildon Windows (including tests) without any additional flags or preinstalled dependencies.rdar://133338086