Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for HYPRLAND_HEADERS environment variable #147

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ PLUGIN_NAME=split-monitor-workspaces
SOURCE_FILES=$(wildcard src/*.cpp)

COMPILE_FLAGS=-g -fPIC --no-gnu-unique -std=c++23
COMPILE_FLAGS+=`pkg-config --cflags pixman-1 libdrm hyprland`
COMPILE_FLAGS+=`pkg-config --cflags pixman-1 libdrm`
COMPILE_FLAGS+=-Iinclude

ifeq ($(HYPRLAND_HEADERS),)
COMPILE_FLAGS+=`pkg-config --cflags hyprland`
else
COMPILE_FLAGS+=-I"$(HYPRLAND_HEADERS)"
COMPILE_FLAGS+=-I"$(HYPRLAND_HEADERS)/protocols/"
endif

COMPILE_DEFINES=-DWLR_USE_UNSTABLE

ifeq ($(shell whereis -b jq), "jq:")
Expand All @@ -22,7 +29,13 @@ endif
all: check_env $(PLUGIN_NAME).so

check_env:
@if pkg-config --exists hyprland; then \
@if [ -n "$(HYPRLAND_HEADERS)" ]; then \
echo 'Using HYPRLAND_HEADERS enviroment variable to find Hyprland headers'; \
if [ ! -d "$(HYPRLAND_HEADERS)/protocols" ]; then \
echo 'Hyprland headers not found'; \
exit 1; \
fi; \
elif pkg-config --exists hyprland; then \
echo 'Hyprland headers found.'; \
else \
echo 'Hyprland headers not available. Run `make pluginenv` in the root Hyprland directory.'; \
Expand Down
Loading