Support the package access modifier in CMake build#3239
Open
ahoppen wants to merge 1 commit intoswiftlang:mainfrom
Open
Support the package access modifier in CMake build#3239ahoppen wants to merge 1 commit intoswiftlang:mainfrom
package access modifier in CMake build#3239ahoppen wants to merge 1 commit intoswiftlang:mainfrom
Conversation
Member
Author
|
@swift-ci Please test |
As far as I can tell, we weren’t passing `-package-name` if the host compiler does not support CMO at all. Since we require Swift 5.9 (indicated by the Package manifest), we can unconditionally set `-package-name`.
50e1d30 to
139981f
Compare
Member
Author
|
@swift-ci Please test |
Member
Author
|
@swift-ci Please test Windows |
rintaro
reviewed
Jan 20, 2026
| set(SWIFTSYNTAX_PACKAGE_NAME "${SWIFT_MODULE_ABI_NAME_PREFIX}${PROJECT_NAME}") | ||
| endif() | ||
|
|
||
| add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-package-name ${SWIFTSYNTAX_PACKAGE_NAME}>") |
Member
There was a problem hiding this comment.
It is debatable whether to put this in global CMakeLists.txt, or to specify target_compile_options in add_swift_syntax_library(). But my personal preference is the latter.
(I admit it was me who added -disable-implicit-string-processing-module-import there, but I think I should move it too)
Member
Author
There was a problem hiding this comment.
I personally like putting it up here because this way it would also apply to any executable target we might add (no plans for it, just design-wise). But you’re CMake knowledge is superior to mine so I’ll defer to your opinion if you still think this should be in add_swift_syntax_library.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As far as I can tell, we weren’t passing
-package-nameif the host compiler does not support CMO at all. Since we require Swift 5.9 (indicated by the Package manifest), we can unconditionally set-package-name.