forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debuggui.sh
58 lines (54 loc) · 2.47 KB
/
debuggui.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
57
58
package: DebugGUI
version: "v0.5.6"
tag: "v0.5.6"
requires:
- "GCC-Toolchain:(?!osx)"
- GLFW
- FreeType
- libuv
build_requires:
- capstone
- CMake
- alibuild-recipe-tools
- ninja
source: https://github.com/AliceO2Group/DebugGUI
---
case $ARCHITECTURE in
osx*)
[[ ! $GLFW_ROOT ]] && GLFW_ROOT=`brew --prefix glfw`
[[ ! $LIBUV_ROOT ]] && LIBUV_ROOT=`brew --prefix libuv`
[[ ! $FREETYPE_ROOT ]] && FREETYPE_ROOT=`brew --prefix freetype`
EXTRA_LIBS="-framework CoreFoundation -framework AppKit"
DEFINES="-DNO_PARALLEL_SORT"
;;
*)
DEFINES="-DIMGUI_IMPL_OPENGL_LOADER_GL3W -DTRACY_NO_FILESELECTOR -DNO_PARALLEL_SORT"
EXTRA_LIBS="-lGL"
! ld -ltbb -o /dev/null 2>/dev/null || EXTRA_LIBS="${EXTRA_LIBS} -ltbb"
[[ ! $FREETYPE_ROOT ]] && FREETYPE_ROOT="/usr"
;;
esac
# build the tracy profiler
rsync -av $SOURCEDIR/tracy/ tracy/
pushd tracy/profiler/build/unix
make ${JOBS+-j $JOBS} \
LIBS="-L$CAPSTONE_ROOT/lib -L$GLFW_ROOT/lib -L$FREETYPE_ROOT/lib -lglfw -lfreetype -lcapstone -lpthread -ldl $EXTRA_LIBS" \
DEFINES="$DEFINES" \
TBB=off \
TRACY_NO_FILESELECTOR=1 \
INCLUDES="-I$CAPSTONE_ROOT/include/capstone -I$SOURCEDIR/tracy/imgui -I$SOURCEDIR/tracy -I$SOURCEDIR/tracy/profiler/libs/gl3w ${FREETYPE_ROOT:+-I$FREETYPE_ROOT/include/freetype2} -I${GLFW_ROOT:+$GLFW_ROOT/include}"
popd
mkdir -p $INSTALLROOT/{include/tracy,bin}
cp tracy/profiler/build/unix/Tracy-* $INSTALLROOT/bin/tracy-profiler
cp tracy/*.{h,hpp,cpp} $INSTALLROOT/include/tracy
cp -r tracy/{common,client,libbacktrace} $INSTALLROOT/include/tracy/
cmake $SOURCEDIR \
-DCMAKE_GENERATOR=Ninja \
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cp ${BUILDDIR}/compile_commands.json ${INSTALLROOT}
cmake --build . -- ${JOBS+-j $JOBS} install
#ModuleFile
mkdir -p etc/modulefiles
alibuild-generate-module --bin --lib > etc/modulefiles/$PKGNAME
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles