Skip to content
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

Support building only tests using SwiftPM #1768

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Oct 17, 2024

This allows us to build everything required for the executable using CMake and only the test targets using SwiftPM, enabling us to run tests on Windows from build.ps1 with minimal overhead.

Analogous to swiftlang/swift-format#851

@ahoppen
Copy link
Member Author

ahoppen commented Oct 17, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Oct 17, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Oct 17, 2024

@swift-ci Please test Windows

This allows us to build everything required for the executable using CMake and only the test targets using SwiftPM, enabling us to run tests on Windows from build.ps1 with minimal overhead.
@ahoppen
Copy link
Member Author

ahoppen commented Oct 17, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Oct 17, 2024

@swift-ci Please test Windows

@@ -1,4 +1,4 @@
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-package-name SourceKitLSP>")
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-package-name sourcekit_lsp>")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the switch?

Copy link
Member Author

Choose a reason for hiding this comment

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

When building the tests using SwiftPM, this is the package name that SwiftPM will chose and it means that we can use declarations at the package level from the modules built using CMake.

@ahoppen ahoppen merged commit 854d362 into swiftlang:main Oct 18, 2024
3 checks passed
@ahoppen ahoppen deleted the build-tests-only branch October 18, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants