aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMihai Fufezan <[email protected]>2024-09-22 20:53:34 +0300
committerMihai Fufezan <[email protected]>2024-09-27 00:07:52 +0300
commitf75f8efb1be227e586cc0ba2ce6153ce56e04314 (patch)
tree8ab775a82e74ed8e1c125d66d99e20379f72e400
parentbe96787ed086f751455cf713739296b5c6e3a235 (diff)
downloadHyprland-f75f8efb1be227e586cc0ba2ce6153ce56e04314.tar.gz
Hyprland-f75f8efb1be227e586cc0ba2ce6153ce56e04314.zip
Meson: add tracy dependency
-rw-r--r--meson.build6
-rw-r--r--meson_options.txt1
-rw-r--r--nix/default.nix7
-rw-r--r--src/meson.build1
-rw-r--r--subprojects/tracy.wrap1
5 files changed, 14 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 42ed519d..3545f46a 100644
--- a/meson.build
+++ b/meson.build
@@ -73,6 +73,12 @@ foreach file : headers
install_headers(file, subdir: 'hyprland', preserve_path: true)
endforeach
+tracy = dependency('tracy', static: true, required: get_option('tracy_enable'))
+
+if get_option('tracy_enable') and get_option('buildtype') != 'debugoptimized'
+ warning('Profiling builds should set -- buildtype = debugoptimized')
+endif
+
subdir('protocols')
subdir('src')
subdir('hyprctl')
diff --git a/meson_options.txt b/meson_options.txt
index 16a34a54..d8c9d5e6 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications')
option('systemd', type: 'feature', value: 'auto', description: 'Enable systemd integration')
option('legacy_renderer', type: 'feature', value: 'disabled', description: 'Enable legacy renderer')
+option('tracy_enable', type: 'boolean', value: false , description: 'Enable profiling')
diff --git a/nix/default.nix b/nix/default.nix
index df270f28..6f086ccc 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -144,7 +144,7 @@ in
mesonBuildType =
if debug
- then "debug"
+ then "debugoptimized"
else "release";
# we want as much debug info as possible
@@ -156,7 +156,10 @@ in
"legacy_renderer" = legacyRenderer;
"systemd" = withSystemd;
})
- (mesonBool "b_pch" false)
+ (mapAttrsToList mesonBool {
+ "b_pch" = false;
+ "tracy_enable" = false;
+ })
];
postInstall = ''
diff --git a/src/meson.build b/src/meson.build
index 7c71a735..2dbe2f44 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -31,6 +31,7 @@ executable(
backtrace_dep,
epoll_dep,
gio_dep,
+ tracy,
# Try to find canihavesomecoffee's udis86 using pkgconfig
# vmt/udis86 does not provide a .pc file and won't be detected this way
diff --git a/subprojects/tracy.wrap b/subprojects/tracy.wrap
new file mode 100644
index 00000000..11b21787
--- /dev/null
+++ b/subprojects/tracy.wrap
@@ -0,0 +1 @@
+[wrap-file]