forked from mullvad/mullvadvpn-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-wireguard-go.sh
executable file
·41 lines (34 loc) · 1.22 KB
/
build-wireguard-go.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# build-wireguard-go.sh
# A helper build script for WireGuardGoBridge via ExternalBuildSystem target in Xcode.
#
# ExternalBuildSystem target configuration:
# Build Tool: /bin/sh
# Arguments: build-wireguard-go.sh $(ACTION)
# Directory: $(SOURCE_ROOT)
# Pass build settings in environment: YES
# Passed by Xcode
ACTION=$1
# Do normal builds when building documentation.
if [ "$ACTION" == "docbuild" ]; then
ACTION="build"
fi
if [ "$SOURCE_PACKAGES_PATH" == "" ]; then
# When archiving, Xcode sets the action to "install"
if [ "$ACTION" == "install" ]; then
SOURCE_PACKAGES_PATH="$BUILD_DIR/../../../../../SourcePackages"
else
SOURCE_PACKAGES_PATH="$BUILD_DIR/../../SourcePackages"
fi
fi
# Resolve SourcesPackages path
RESOLVED_SOURCE_PACKAGES_PATH="$( cd "$SOURCE_PACKAGES_PATH" && pwd -P )"
if [ "$RESOLVED_SOURCE_PACKAGES_PATH" == "" ]; then
echo "Failed to resolve the SourcePackages path: $SOURCE_PACKAGES_PATH"
exit 1
fi
# Compile the path to the Makefile directory
WIREGUARD_KIT_GO_PATH="$RESOLVED_SOURCE_PACKAGES_PATH/checkouts/wireguard-apple/Sources/WireGuardKitGo"
echo "WireGuardKitGo path resolved to $WIREGUARD_KIT_GO_PATH"
# Run make
/usr/bin/make -C "$WIREGUARD_KIT_GO_PATH" $ACTION