-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuild.sh
executable file
·56 lines (47 loc) · 1.51 KB
/
build.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! /bin/bash -ex
cpu="$(uname -m)"
case "$cpu" in
x86_64)
cpu="x64";;
i686)
cpu="x86";;
esac
if [[ $(uname) = Linux ]] ; then
QT_FEATURES=",xcb,xcb-xlib,xkb,xkbcommon-x11,xlib,xrender,fontconfig,harfbuzz,egl"
cmake_preset="ninja-vcpkg"
triplet=$cpu-linux
buildtrees=vcpkg/buildtrees
rtaudio_opts='[alsa]'
rtmidi_opts='[alsa]'
elif [[ $(uname) = Darwin ]] ; then
QT_FEATURES=",harfbuzz"
cmake_preset="ninja-vcpkg"
triplet=$cpu-osx
buildtrees=vcpkg/buildtrees
rtaudio_opts=
rtmidi_opts=
else
QT_FEATURES=""
cmake_preset="vs-vcpkg"
triplet=$cpu-win
buildtrees="C:\B"
rtaudio_opts='[asio]'
rtmidi_opts=
fi
if [[ "$1" != "" ]]; then
triplet="$1"
fi
if [[ ! -x vcpkg/vcpkg ]] ; then
vcpkg/bootstrap-vcpkg.sh
else
vcpkg/vcpkg --overlay-triplets=vcpkg-overlay/triplets $vcpkg_option upgrade --no-dry-run --debug --allow-unsupported
fi
vcpkg_triplet="--triplet ${triplet}-clap-host --host-triplet ${triplet}-clap-host"
cmake_triplet="-DVCPKG_TARGET_TRIPLET=${triplet}-clap-host -DVCPKG_HOST_TRIPLET=${triplet}-clap-host"
vcpkg/vcpkg --overlay-triplets=vcpkg-overlay/triplets $vcpkg_triplet install --recurse \
"rtmidi${rtmidi_opts}" "rtaudio${rtaudio_opts}" "qtbase[core,png,widgets,doubleconversion,concurrent,appstore-compliant,freetype${QT_FEATURES}]"
# save space
rm -rf vcpkg/buildtrees
vcpkg/vcpkg --overlay-triplets=vcpkg-overlay/triplets $vcpkg_options upgrade --debug
cmake --preset $cmake_preset $cmake_triplet
cmake --build --preset $cmake_preset --config Release --target clap-host