Merged
Conversation
Contributor
|
Tested with GitHub workflow, https://github.com/cntrump/SwiftZST_Test |
This commit makes several changes: 1. It adds modules for the dictionary builder and errors headers. 2. It captures all of the macros that are used to configure these headers. When the headers are imported as modules and one of these macros is defined the compiler issues a warning that it needs to be defined on the CLI. 3. It promotes the modulemap file into the root of the lib directory. Experimentation shows that clang's `-fimplicit-module-maps` will find the modulemap when placed here, but not when it's put in a subdirectory.
0d3d902 to
1778222
Compare
Cyan4973
approved these changes
Jan 6, 2022
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.
Internal discussion raised the question of how compatible zstd's headers are with C++ Modules, given that we use configuration macros to control what is exposed by
zstd.h. This is a valid topic that is probably worth further discussion. It may be that the right approach is to expose a secondlibzstd-staticmodule that exports the static definitions.For the time being though, this PR makes several changes that seem worthwhile:
module.modulemapfile into the root of the lib directory. Experimentation shows that clang's-fimplicit-module-mapswill find the module map when placed here, but not when it's put in a subdirectory.I know the module map was initially added in #2858. I don't have the capability to test whether these changes are compatible. Ideally @cntrump could weigh in.
To-do: create tests that can be added to validate that zstd remains compatible with modules. This is complicated by the fact that support is still experimental and present in only the most recent compilers.