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

Enable target with headers but no sources as ClangTarget #6006

Merged
merged 2 commits into from Jan 3, 2023

Conversation

k-kohey
Copy link
Contributor

@k-kohey k-kohey commented Dec 28, 2022

This PR change allows the generation of targets containing only header files.

Motivation:

Closes #4806 .
Currently, if we attempt to create a target that does not contain source files, the Swift Package Manager returns an error and prompts us to put the source files. Therefore, it is not possible to create a CLangTarget that only contains header files.

Modifications:

Changed so that if a header file exists, the Target generation process continues even if no source file exists.

Result:

With the changes in this PR, a target that does not contain source files but does contain headers is a CLangTarget.

@MaxDesiatov
Copy link
Member

@swift-ci please smoke test

@k-kohey k-kohey changed the title Target that does not contain source but only headers is made into a CLangTarget. Target that does not contain sources but only headers is made into a CLangTarget. Dec 28, 2022
@k-kohey k-kohey changed the title Target that does not contain sources but only headers is made into a CLangTarget. Enable target that does not contain sources but only headers to be made into a CLangTarget Dec 28, 2022
@MaxDesiatov MaxDesiatov changed the title Enable target that does not contain sources but only headers to be made into a CLangTarget Enable target with headers but no sources as ClangTarget Dec 28, 2022
@k-kohey k-kohey marked this pull request as ready for review January 3, 2023 05:05
@tomerd
Copy link
Member

tomerd commented Jan 3, 2023

looks good to me. @neonichu @abertelrud ?

@tomerd tomerd merged commit 2fb7ecc into apple:main Jan 3, 2023
@tomerd
Copy link
Member

tomerd commented Jan 3, 2023

thanks @k-kohey

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.

[SR-7825] SwiftPM should consider a target with header files but no sources as a ClangTarget
4 participants