diff --git a/Package.swift b/Package.swift index 75a5a0b3323..97f2c6a5251 100644 --- a/Package.swift +++ b/Package.swift @@ -25,7 +25,7 @@ let package = Package( name: "libzstd", path: "lib", sources: [ "common", "compress", "decompress", "dictBuilder" ], - publicHeadersPath: "modulemap", + publicHeadersPath: ".", cSettings: [ .headerSearchPath(".") ]) diff --git a/lib/module.modulemap b/lib/module.modulemap new file mode 100644 index 00000000000..bbb939782e1 --- /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 eeda6988543..00000000000 --- a/lib/modulemap/module.modulemap +++ /dev/null @@ -1,4 +0,0 @@ -module libzstd [extern_c] { - header "../zstd.h" - export * -}