From 620371324a068bbe6c5bd77d1719a19fa128f7e0 Mon Sep 17 00:00:00 2001 From: Sami Liedes Date: Wed, 7 Aug 2024 15:42:07 +0200 Subject: [PATCH] hyprctl: link to much less libraries This makes hyprctl start significantly faster. $ time for ((i=0; i<1000; i++)); do hyprctl/hyprctl -j activewindow >/dev/null; done Before: 12.269 s (about 12.3 ms/execution) After: 2.142 s (about 2.1 ms/execution) --- CMakeLists.txt | 6 ++++++ hyprctl/CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa58b63dc27..fc8eafd56d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,6 +87,12 @@ else() endif() find_package(OpenGL REQUIRED COMPONENTS ${GLES_VERSION}) +pkg_check_modules( + hyprctl_deps + REQUIRED + IMPORTED_TARGET + hyprutils>=0.2.1) + pkg_check_modules( deps REQUIRED diff --git a/hyprctl/CMakeLists.txt b/hyprctl/CMakeLists.txt index 64b983e6296..aaffe411af7 100644 --- a/hyprctl/CMakeLists.txt +++ b/hyprctl/CMakeLists.txt @@ -9,7 +9,7 @@ pkg_check_modules(deps REQUIRED IMPORTED_TARGET hyprutils>=0.1.1) add_executable(hyprctl "main.cpp") -target_link_libraries(hyprctl PUBLIC PkgConfig::deps) +target_link_libraries(hyprctl PUBLIC PkgConfig::hyprctl_deps) # binary install(TARGETS hyprctl)