aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-03-01 14:14:28 +0000
committerVaxry <[email protected]>2024-03-01 14:14:28 +0000
commit4937352761525de4b034e5f0152261ff5e7552f3 (patch)
treee51e33280a561361ad2ee222de15c0143b4acfdd /Makefile
parentf590505daf90dfb4059289a906863b59663e70a6 (diff)
downloadHyprland-4937352761525de4b034e5f0152261ff5e7552f3.tar.gz
Hyprland-4937352761525de4b034e5f0152261ff5e7552f3.zip
makefile: add asan
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 9c5e94d5..c893a16a 100644
--- a/Makefile
+++ b/Makefile
@@ -106,3 +106,24 @@ man:
--variable=section:1 \
--from rst \
--to man > ./docs/hyprctl.1
+
+asan:
+ @echo -en "!!WARNING!!\nOnly run this in the TTY.\n"
+ @pidof Hyprland > /dev/null && echo -ne "Refusing to run with Hyprland running.\n" || echo ""
+ @pidof Hyprland > /dev/null && exit 1 || echo ""
+
+ rm -rf ./wayland
+ git reset --hard
+
+ git clone --recursive https://gitlab.freedesktop.org/wayland/wayland
+ cd wayland && patch -p1 < ../scripts/waylandStatic.diff && meson setup build --buildtype=debug -Db_sanitize=address -Ddocumentation=false && ninja -C build && cd ..
+ cp ./wayland/build/src/libwayland-server.a .
+ @echo "Wayland done"
+
+ patch -p1 < ./scripts/hyprlandStaticAsan.diff
+ cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DWITH_ASAN:STRING=True -DUSE_TRACY:STRING=False -DUSE_TRACY_GPU:STRING=False -S . -B ./build -G Ninja
+ cmake --build ./build --config Debug --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
+ @echo "Hyprland done"
+
+ ASAN_OPTIONS="detect_odr_violation=0,log_path=asan.log" HYPRLAND_NO_CRASHREPORTER=1 ./build/Hyprland
+