]> git.ipfire.org Git - thirdparty/wireguard-apple.git/blame - README.md
global: apply MIT more consistently
[thirdparty/wireguard-apple.git] / README.md
CommitLineData
fda36b57 1# [WireGuard](https://www.wireguard.com/) for iOS and macOS
8aeca613 2
a66f13eb
JD
3This project contains an application for iOS and for macOS, as well as many components shared between the two of them. You may toggle between the two platforms by selecting the target from within Xcode.
4
4bcfdfa0 5## Building
ae73b789 6
a66f13eb 7- Clone this repo:
ad7fc0b5 8
4bcfdfa0 9```
a66f13eb
JD
10$ git clone https://git.zx2c4.com/wireguard-apple
11$ cd wireguard-apple
4bcfdfa0
JD
12```
13
4bcfdfa0
JD
14- Rename and populate developer team ID file:
15
16```
5a1c9598
AM
17$ cp Sources/WireGuardApp/Config/Developer.xcconfig.template Sources/WireGuardApp/Config/Developer.xcconfig
18$ vim Sources/WireGuardApp/Config/Developer.xcconfig
4bcfdfa0
JD
19```
20
d696e31b 21- Install swiftlint and go 1.15:
de14b76b
EK
22
23```
4503c11b 24$ brew install swiftlint go
de14b76b
EK
25```
26
ca088e9d 27- Open project in Xcode:
4bcfdfa0
JD
28
29```
5a1c9598 30$ open WireGuard.xcodeproj
4bcfdfa0
JD
31```
32
ca088e9d 33- Flip switches, press buttons, and make whirling noises until Xcode builds it.
5b6b71c6 34
ef7de250
AM
35## WireGuardKit integration
36
371. Open your Xcode project and add the Swift package with the following URL:
38
39 ```
40 https://git.zx2c4.com/wireguard-apple
41 ```
42
ef7de250
AM
432. `WireGuardKit` links against `wireguard-go-bridge` library, but it cannot build it automatically
44 due to Swift package manager limitations. So it needs a little help from a developer.
45 Please follow the instructions below to create a build target(s) for `wireguard-go-bridge`.
46
47 - In Xcode, click File -> New -> Target. Switch to "Other" tab and choose "External Build
48 System".
49 - Type in `WireGuardGoBridge<PLATFORM>` under the "Product name", replacing the `<PLATFORM>`
50 placeholder with the name of the platform. For example, when targeting macOS use `macOS`, or
51 when targeting iOS use `iOS`.
52 Make sure the build tool is set to: `/usr/bin/make` (default).
53 - In the appeared "Info" tab of a newly created target, type in the "Directory" path under
54 the "External Build Tool Configuration":
55
56 ```
b9ff5c2e 57 ${BUILD_DIR%Build/*}SourcePackages/checkouts/wireguard-apple/Sources/WireGuardKitGo
ef7de250
AM
58 ```
59
60 - Switch to "Build Settings" and find `SDKROOT`.
61 Type in `macosx` if you target macOS, or type in `iphoneos` if you target iOS.
62
633. Go to Xcode project settings and locate your network extension target and switch to
64 "Build Phases" tab.
65
66 - Locate "Dependencies" section and hit "+" to add `WireGuardGoBridge<PLATFORM>` replacing
67 the `<PLATFORM>` placeholder with the name of platform matching the network extension
68 deployment target (i.e macOS or iOS).
69
70 - Locate the "Link with binary libraries" section and hit "+" to add `WireGuardKit`.
71
724. In Xcode project settings, locate your main bundle app and switch to "Build Phases" tab.
73 Locate the "Link with binary libraries" section and hit "+" to add `WireGuardKit`.
74
755. iOS only: Locate Bitcode settings under your application target, Build settings -> Enable Bitcode,
76 change the corresponding value to "No".
77
78Note that if you ship your app for both iOS and macOS, make sure to repeat the steps 2-4 twice,
79once per platform.
80
ac5d2b2a
JD
81## MIT License
82
83Permission is hereby granted, free of charge, to any person obtaining a copy of
84this software and associated documentation files (the "Software"), to deal in
85the Software without restriction, including without limitation the rights to
86use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
87of the Software, and to permit persons to whom the Software is furnished to do
88so, subject to the following conditions:
89
90The above copyright notice and this permission notice shall be included in all
91copies or substantial portions of the Software.
92
93THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
94IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
95FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
96AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
97LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
98OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
99SOFTWARE.