mirror of
				https://github.com/ItsDrike/hyprland-dwindle-autogroup.git
				synced 2025-11-04 01:16:36 +00:00 
			
		
		
		
	Hyprland has recently changed the way plugins recognize the hyprland headers, moving from directly including the paths with -I option to automatically generating the cflags with `pkg-config --cflags hyprland`. This change means that compilation attempts using the direct include option will start to fail with newer versions of hyprland, which now uses /usr/local/include for it's headers after `make pluginenv`. This commit migrates the original system to respect this change, modifying Makefile, and with it, the include paths for hyprland headers, which are now prefixed with hyprland/.
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			916 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			916 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
# compile with HYPRLAND_HEADERS=<path_to_hl> make all
 | 
						|
# make sure that the path above is to the root hl repo directory, NOT src/
 | 
						|
# and that you have ran `make protocols` in the hl dir.
 | 
						|
 | 
						|
PLUGIN_NAME=dwindle-autogroup
 | 
						|
 | 
						|
SOURCE_FILES=$(wildcard src/*.cpp)
 | 
						|
 | 
						|
.PHONY: clean clangd
 | 
						|
 | 
						|
all: check_env $(PLUGIN_NAME).so
 | 
						|
 | 
						|
install: all
 | 
						|
	cp $(PLUGIN_NAME).so ${HOME}/.local/share/hyprload/plugins/bin
 | 
						|
 | 
						|
check_env:
 | 
						|
	@if ! pkg-config --exists hyprland; then \
 | 
						|
		echo 'Hyprland headers not available. Run `make pluginenv` in the root Hyprland directory.'; \
 | 
						|
		exit 1; \
 | 
						|
	fi
 | 
						|
 | 
						|
$(PLUGIN_NAME).so: $(SOURCE_FILES) $(INCLUDE_FILES)
 | 
						|
	g++ -shared -fPIC --no-gnu-unique $(SOURCE_FILES) -o $(PLUGIN_NAME).so -g `pkg-config --cflags pixman-1 libdrm hyprland` -Iinclude -std=c++23
 | 
						|
 | 
						|
clean:
 | 
						|
	rm ./${PLUGIN_NAME}.so
 | 
						|
 | 
						|
clangd:
 | 
						|
	printf "%b" "`pkg-config --cflags pixman-1 libdrm hyprland | sed 's/ -/\n-/g'`\n-Iinclude\n-std=c++2b" > compile_flags.txt
 |