aboutsummaryrefslogtreecommitdiffhomepage
path: root/trace_profile/tracy/get-tracy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'trace_profile/tracy/get-tracy.sh')
-rw-r--r--trace_profile/tracy/get-tracy.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/trace_profile/tracy/get-tracy.sh b/trace_profile/tracy/get-tracy.sh
new file mode 100644
index 0000000..4fab480
--- /dev/null
+++ b/trace_profile/tracy/get-tracy.sh
@@ -0,0 +1,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)