From: W. Felix Handte Date: Thu, 23 Dec 2021 19:57:16 +0000 (-0500) Subject: Improve Module Map File X-Git-Tag: v1.5.2^2~12^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8dd943e42c13ca33d07ead274e07defd1e2114c5;p=thirdparty%2Fzstd.git Improve Module Map File 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. --- diff --git a/lib/module.modulemap b/lib/module.modulemap new file mode 100644 index 000000000..bbb939782 --- /dev/null +++ b/lib/module.modulemap @@ -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 * + } +} diff --git a/lib/modulemap/module.modulemap b/lib/modulemap/module.modulemap deleted file mode 100644 index eeda69885..000000000 --- a/lib/modulemap/module.modulemap +++ /dev/null @@ -1,4 +0,0 @@ -module libzstd [extern_c] { - header "../zstd.h" - export * -}