aboutsummaryrefslogtreecommitdiffhomepage
path: root/trace_profile/tracy/get-tracy.sh
blob: 4fab480752e5a93b9b93f81be31dca932439c8d4 (plain) (blame)
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
#!/bin/bash

# -- DOWNLOAD -------------------------------------------------------------------

test -f tracy.json || curl -s -L https://api.github.com/repos/wolfpld/tracy/releases/latest > tracy.json
TRACY_URL=$(cat tracy.json | jq -r .tarball_url)
TRACY_TAG=$(cat tracy.json | jq -r .tag_name)

echo TRACY_URL $TRACY_URL
echo TRACY_TAG $TRACY_TAG

if ! test -d tracy; then
    wget --no-clobber -O tracy-$TRACY_TAG.tgz $TRACY_URL
    mkdir tracy
    tar xf tracy-$TRACY_TAG.tgz -C tracy --strip-component 1
    echo $TRACY_TAG > tracy/VERSION
elif ! test $TRACY_TAG = $(cat tracy/VERSION); then
    echo -e "\e[1;33mWARN\e[0m: new tracy version available have:$(cat tracy/VERSION) new:$TRACY_TAG"
fi

export CC=$(which clang)
export CXX=$(which clang++)

# -- BUILD PROFILER -------------------------------------------------------------

if ! test -d build-profiler; then
    # Legacy -> x11
    cmake -B build-profiler -S tracy/profiler -DLEGACY=ON
fi

cmake --build build-profiler -j$(nproc)

# -- BUILD CAPTURE --------------------------------------------------------------

if ! test -d build-capture; then
    cmake -B build-capture -S tracy/capture
fi

cmake --build build-capture/ -j$(nproc)