Skip to content

Commit 58d6aa5

Browse files
aleksprogerAleksei
and
Aleksei
authored
Support Apple's Swift Package Manager (nlohmann#4010)
Co-authored-by: Aleksei <[email protected]>
1 parent edffad0 commit 58d6aa5

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@
3939
/localhost.pem
4040
/localhost-key.pem
4141
/serve_header.yml
42+
43+
# Swift Package Manager build directory
44+
/.build

Package.swift

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "nlohmann-json",
8+
platforms: [
9+
.iOS(.v12), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v4)
10+
],
11+
products: [
12+
.library(name: "json", targets: ["json"])
13+
],
14+
targets: [
15+
.target(
16+
name: "json",
17+
path: "single_include/nlohmann",
18+
publicHeadersPath: "."
19+
)
20+
],
21+
cxxLanguageStandard: .cxx11
22+
)

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,8 @@ If you are using [cget](https://cget.readthedocs.io/en/latest/), you can install
13381338

13391339
If you are using [CocoaPods](https://cocoapods.org), you can use the library by adding pod `"nlohmann_json", '~>3.1.2'` to your podfile (see [an example](https://bitbucket.org/benman/nlohmann_json-cocoapod/src/master/)). Please file issues [here](https://bitbucket.org/benman/nlohmann_json-cocoapod/issues?status=new&status=open).
13401340

1341+
If you are using [Swift Package Manager](https://swift.org/package-manager/), you can use the library by adding a package dependency to this repository. And target dependency as `.product(name: "nlohmann-json", package: "json")`.
1342+
13411343
If you are using [NuGet](https://www.nuget.org), you can use the package [nlohmann.json](https://www.nuget.org/packages/nlohmann.json/). Please check [this extensive description](https://github.com/nlohmann/json/issues/1132#issuecomment-452250255) on how to use the package. Please file issues [here](https://github.com/hnkb/nlohmann-json-nuget/issues).
13421344

13431345
If you are using [conda](https://conda.io/), you can use the package [nlohmann_json](https://github.com/conda-forge/nlohmann_json-feedstock) from [conda-forge](https://conda-forge.org) executing `conda install -c conda-forge nlohmann_json`. Please file issues [here](https://github.com/conda-forge/nlohmann_json-feedstock/issues).

0 commit comments

Comments
 (0)