-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-cmd.sh
More file actions
executable file
·109 lines (93 loc) · 3.48 KB
/
Copy pathbuild-cmd.sh
File metadata and controls
executable file
·109 lines (93 loc) · 3.48 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env bash
cd "$(dirname "$0")"
# turn on verbose debugging output for logs.
exec 4>&1; export BASH_XTRACEFD=4; set -x
# make errors fatal
set -e
# bleat on references to undefined shell variables
set -u
NATIVE_SOURCE_DIR="sentry-native"
COCOA_SOURCE_DIR="sentry-cocoa"
top="$(pwd)"
stage="$top"/stage
# load autobuild provided shell functions and variables
case "$AUTOBUILD_PLATFORM" in
windows*)
autobuild="$(cygpath -u "$AUTOBUILD")"
;;
*)
autobuild="$AUTOBUILD"
;;
esac
source_environment_tempfile="$stage/source_environment.sh"
"$autobuild" source_environment > "$source_environment_tempfile"
. "$source_environment_tempfile"
version="8.55.1-0.7.17"
echo "${version}" > "${stage}/VERSION.txt"
case "$AUTOBUILD_PLATFORM" in
# ------------------------ windows, windows64 ------------------------
windows*)
pushd "$NATIVE_SOURCE_DIR"
mkdir -p "build_release"
pushd "build_release"
# Invoke cmake and use as official build
cmake -G Ninja .. \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_INSTALL_PREFIX=$(cygpath -w "$stage/sentry")
cmake --build . --config RelWithDebInfo
cmake --install . --config RelWithDebInfo
popd
popd
pushd "$stage/sentry"
mkdir -p "$stage/include/sentry"
mkdir -p "$stage/bin/release"
mkdir -p "$stage/lib/release"
cp -a bin/crashpad_handler.* "$stage/bin/release"
cp -a bin/sentry.* "$stage/lib/release"
cp -a lib/*.lib "$stage/lib/release"
cp -a include/* "$stage/include/sentry"
popd
;;
# ------------------------- darwin, darwin64 -------------------------
darwin*)
pushd "$COCOA_SOURCE_DIR"
carthage build --no-skip-current --platform macOS --verbose
mkdir -p "$stage/lib/release"
pushd "Carthage/Build/Mac/Sentry.framework"
mkdir -p "$stage/include/sentry"
mv Headers/* $stage/include/sentry/
rm -r Headers PrivateHeaders Modules
pushd "Versions/A/"
rm -r Headers PrivateHeaders Modules
popd
popd
cp -a Carthage/Build/Mac/* $stage/lib/release/
popd
;;
# -------------------------- linux, linux64 --------------------------
linux*)
pushd "$NATIVE_SOURCE_DIR"
# Default target per --address-size
opts_cxx="${TARGET_OPTS:--m$AUTOBUILD_ADDRSIZE $LL_BUILD_RELEASE}"
opts_c="$(remove_cxxstd $opts)"
# Release
mkdir -p "build_release"
pushd "build_release"
cmake ../ -G"Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_C_FLAGS="$opts_c" \
-DCMAKE_CXX_FLAGS="$opts_cxx" \
-DCMAKE_INSTALL_PREFIX="$stage" \
-DCMAKE_INSTALL_LIBDIR="$stage/lib/release" \
-DSENTRY_BUILD_SHARED_LIBS=ON \
-DSENTRY_BACKEND="crashpad"
cmake --build . --config RelWithDebInfo --parallel $AUTOBUILD_CPU_COUNT
cmake --install . --config RelWithDebInfo
popd
popd
;;
esac
mkdir -p "$stage/LICENSES"
cp $NATIVE_SOURCE_DIR/LICENSE "$stage/LICENSES/sentry.txt"