Skip to content

[CMake] Exclude swift-syntax targets from 'all' #74733

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

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jun 26, 2024

All targets in swift-syntax included via FetchContent are for some dependencies. They should not be included in all

@rintaro rintaro marked this pull request as draft June 26, 2024 16:18
@rintaro
Copy link
Member Author

rintaro commented Jun 26, 2024

swiftlang/swift-syntax#2705
@swift-ci Please clean smoke test

@rintaro rintaro marked this pull request as ready for review June 26, 2024 20:25
@rintaro
Copy link
Member Author

rintaro commented Jun 26, 2024

swiftlang/swift-syntax#2705
@swift-ci Please clean smoke test

@rintaro rintaro force-pushed the cmake-swiftsyntax-exclude-from-all branch from 78a4f9e to b1bca24 Compare August 29, 2024 18:40
@rintaro
Copy link
Member Author

rintaro commented Aug 29, 2024

@swift-ci Please smoke test

@rintaro rintaro force-pushed the cmake-swiftsyntax-exclude-from-all branch from b1bca24 to e80ec92 Compare August 29, 2024 18:45
@rintaro
Copy link
Member Author

rintaro commented Aug 29, 2024

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Aug 29, 2024

@swift-ci Please smoke test Windows

Copy link
Member

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

I thought that property was supposed to be set on the source directory to exclude any targets under that directory from the all target?

@rintaro
Copy link
Member Author

rintaro commented Sep 9, 2024

According to https://cmake.org/cmake/help/latest/command/set_property.html

New in version 3.19: <dir> may reference a binary directory.

@etcwilde
Copy link
Member

etcwilde commented Sep 9, 2024

New in version 3.19: <dir> may reference a binary directory.

Sure, you can set a property on a binary directory after 3.19, but I don't know if that means that the EXCLUDE_FROM_ALL is applied to targets that are declared under the project source directory that corresponds to that binary directory.

CC @compnerd, do you know?

@rintaro
Copy link
Member Author

rintaro commented Sep 9, 2024

Yeah, but it doesn't matter, we want EXCLUDE_FROM_ALL anyway in this swift CMake. And this is just a workaround until 3.28.

We only want swift-syntax libraries as dependencies
@rintaro rintaro force-pushed the cmake-swiftsyntax-exclude-from-all branch from 82147ae to 4a39290 Compare September 10, 2024 00:14
@rintaro
Copy link
Member Author

rintaro commented Sep 10, 2024

@swift-ci Please smoke test

Copy link
Member

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

Okay, I've confirmed that the Exclusion does get applied back to targets declared in the corresponding source directory too. I wasn't sure that this PR was doing anything, but it looks like it should work.

@rintaro rintaro merged commit 0709d69 into swiftlang:main Sep 10, 2024
3 checks passed
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