blob: daa563a5fa02b3ffe99b126d79a56f937bbfc2cb (
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
|
#!/bin/bash
# author: nasr
# rebuilds only the ui (build/design_ui.so). a running debug build picks it up instantly.
set -e
cd "$(dirname "$0")"
date
echo "Reloading the design-it ui"
BUILD_DIR=build
SOURCE_DIR=source
GEN_DIR=${BUILD_DIR}/generated
INCLUDES="-I${SOURCE_DIR} -I${SOURCE_DIR}/base -I${SOURCE_DIR}/core -I${SOURCE_DIR}/platform -I${SOURCE_DIR}/render -I${SOURCE_DIR}/diagram -I${SOURCE_DIR}/app -I${GEN_DIR} -I${SOURCE_DIR}/render/shaders/prebuilt -I${SOURCE_DIR}/third_party"
INCLUDES+=" $(pkg-config --cflags freetype2 harfbuzz xkbcommon)"
CFLAGS="-std=c++20 -fno-rtti -fno-exceptions -Wall -Wundef -Werror -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-missing-field-initializers -Wno-format-truncation -fno-omit-frame-pointer"
CFLAGS+=" -DWAYLAND=1 -DVULKAN=1 -O0 -g3 -DDEBUG=1 -DDESIGN_HOT_RELOAD=1 -DDESIGN_UI_DLL=1"
LIBS="-pthread -lm -ldl -lwayland-client -lX11 $(pkg-config --libs freetype2 harfbuzz xkbcommon)"
if [ ! -f "${GEN_DIR}/xdg-shell-client.h" ]; then
echo "run ./compile.sh once first"
exit 1
fi
time g++ $INCLUDES $CFLAGS -fPIC -shared "${SOURCE_DIR}/app/app.cpp" ${GEN_DIR}/*-protocol.o -fuse-ld=mold -o "${BUILD_DIR}/design_ui.so.tmp" $LIBS
mv "${BUILD_DIR}/design_ui.so.tmp" "${BUILD_DIR}/design_ui.so"
echo "==== RELOAD BUILT ===="
|