From f70554664408326ce9677f974bddc8c31c7c2749 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Mon, 23 Sep 2024 10:39:07 +0300 Subject: [PATCH] CMakeLists.txt: generation of apitrace running utilities --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fee3cbe..0229f37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,10 +292,18 @@ function(use_townengine target sources output_directory data_dir) string(JOIN "\n" TWN_BOOTSTRAP_SH "#!/bin/env sh" "cd \"$(dirname \"$0\")\"" - "export LD_LIBRARY_PATH=./" + "export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:./\"" "if [ \"\$1\" = \"gdb\" ]; then" " unset DEBUGINFOD_URLS" " gdb -ex run --args ./launcher ${TWN_BOOTSTRAP_EXEC_ARGS}" + "elif [ \"\$1\" = \"apitrace-take\" ]; then" + " export ASAN_OPTIONS=verify_asan_link_order=0" + " export LD_PRELOAD=\"/usr/lib/libubsan.so.1 /usr/lib/apitrace/wrappers/glxtrace.so \$LD_PRELOAD\"" + " ./launcher ${TWN_BOOTSTRAP_EXEC_ARGS}" + "elif [ \"\$1\" = \"apitrace-use\" ]; then" + " traces=( launcher.*.trace )" + " trace=\${traces[-1]}" + " qapitrace \${trace}" "else" " ./launcher ${TWN_BOOTSTRAP_EXEC_ARGS}" "fi"