Skip to content

Commit

Permalink
Improve Module Map File
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
felixhandte committed Dec 23, 2021
1 parent eebf24b commit 9fc9c34
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
25 changes: 25 additions & 0 deletions lib/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module libzstd [extern_c] {
header "zstd.h"
export *
config_macros [exhaustive] /* zstd.h */ \
ZSTD_STATIC_LINKING_ONLY, \
ZSTDLIB_VISIBLE, \
ZSTD_DLL_EXPORT, \
ZSTDLIB_STATIC_API, \
ZSTD_DISABLE_DEPRECATE_WARNINGS, \
ZSTD_CLEVEL_DEFAULT, \
/* zdict.h */ ZDICT_STATIC_LINKING_ONLY, \
ZDICTLIB_VISIBILITY, \
ZDICT_DISABLE_DEPRECATE_WARNINGS, \
/* zstd_errors.h */ ZSTDERRORLIB_VISIBILITY

module dictbuilder [extern_c] {
header "zdict.h"
export *
}

module errors [extern_c] {
header "zstd_errors.h"
export *
}
}
4 changes: 0 additions & 4 deletions lib/modulemap/module.modulemap

This file was deleted.

0 comments on commit 9fc9c34

Please sign in to comment.