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 Swift Package Manager #2858

Merged
merged 2 commits into from
Nov 17, 2021

Conversation

cntrump
Copy link
Contributor

@cntrump cntrump commented Nov 14, 2021

No description provided.

@@ -0,0 +1 @@
../zstd.h
Copy link
Contributor

Choose a reason for hiding this comment

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

?
This seems a strange content for a *.h header file ?

Copy link
Contributor Author

@cntrump cntrump Nov 15, 2021

Choose a reason for hiding this comment

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

Because SPM needs a separated publicHeadersPath, so I create a symbol link to ../zstd.h

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you call a "symbol link" ?
Is that a specific SPM concept, or is it the standard unix' ln -s link ?

Copy link
Contributor Author

@cntrump cntrump Nov 15, 2021

Choose a reason for hiding this comment

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

Yes, It is a symbol link created by ln -s ../zstd.h zstd.h

Package.swift Outdated
name: "zstd",
path: "lib",
sources: [ "common", "compress", "decompress", "dictBuilder" ],
publicHeadersPath: "include",
Copy link
Contributor

Choose a reason for hiding this comment

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

What about publicHeadersPath: "." (or equivalent) ?
Is that forbidden or meaningless ?

Copy link
Contributor Author

@cntrump cntrump Nov 15, 2021

Choose a reason for hiding this comment

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

I tried, it can't work

$ swift build

'zstd' ./zstd: error: target 'zstd' has invalid header layout: umbrella header found at './zstd/lib/zstd.h', but directories exist next to it: ./zstd/lib/common, ./zstd/lib/compress, ./zstd/lib/decompress, ./zstd/lib/deprecated, ./zstd/lib/dictBuilder, ./zstd/lib/dll, ./zstd/lib/include, ./zstd/lib/legacy; consider removing them

And finally, I figure it out. Using a module.modulemap replace symbol link for public header.

And renamed lib name zstd to libzstd

@Cyan4973
Copy link
Contributor

Cyan4973 commented Nov 17, 2021

Thanks for adding this Swift Package support !

@Cyan4973 Cyan4973 merged commit f56de11 into facebook:dev Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants