Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let package = Package(
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "libzstd",
type: .static,
targets: [ "libzstd" ])
],
dependencies: [
Expand All @@ -25,7 +26,7 @@ let package = Package(
name: "libzstd",
path: "lib",
sources: [ "common", "compress", "decompress", "dictBuilder" ],
publicHeadersPath: ".",
publicHeadersPath: "spm",
cSettings: [
.headerSearchPath(".")
])
Expand Down
14 changes: 14 additions & 0 deletions lib/spm/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module libzstd [extern_c] {
header "zstd_shim.h"
export *

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

module errors [extern_c] {
header "../zstd_errors.h"
export *
}
}
17 changes: 17 additions & 0 deletions lib/spm/zdict_shim.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under both the BSD-style license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
*/

#ifndef ZSTD_ZDICT_SHIM_H
#define ZSTD_ZDICT_SHIM_H

#define ZSTD_STATIC_LINKING_ONLY
#include "../zdict.h"

#endif /* ZSTD_ZDICT_SHIM_H */
17 changes: 17 additions & 0 deletions lib/spm/zstd_shim.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under both the BSD-style license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
*/

#ifndef ZSTD_SHIM_H
#define ZSTD_SHIM_H

#define ZSTD_STATIC_LINKING_ONLY
#include "../zstd.h"

#endif /* ZSTD_SHIM_H */