mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 08:03:21 +02:00
chore: parallelize build (#90)
This commit is contained in:
parent
cb39e89fc3
commit
d6eb0b798c
2 changed files with 16 additions and 6 deletions
19
Makefile
19
Makefile
|
@ -1,18 +1,27 @@
|
||||||
PLUGIN_NAME=dynamic-cursors
|
PLUGIN_NAME=dynamic-cursors
|
||||||
|
|
||||||
SOURCE_FILES=$(wildcard ./src/*.cpp ./src/*/*.cpp)
|
SOURCE_FILES := $(wildcard ./src/*.cpp ./src/*/*.cpp)
|
||||||
|
OBJECT_FILES := $(patsubst ./src/%.cpp, out/%.o, $(SOURCE_FILES))
|
||||||
|
CXX_FLAGS := -Wall --no-gnu-unique -fPIC -std=c++26 -g \
|
||||||
|
$(shell pkg-config --cflags hyprland | awk '{print $$NF "/src";}') \
|
||||||
|
$(shell pkg-config --cflags pixman-1 libdrm hyprland)
|
||||||
|
|
||||||
OUTPUT=out/$(PLUGIN_NAME).so
|
OUTPUT=out/$(PLUGIN_NAME).so
|
||||||
|
|
||||||
.PHONY: all clean load unload
|
.PHONY: all clean load unload
|
||||||
|
|
||||||
all: $(OUTPUT)
|
all: $(OUTPUT)
|
||||||
|
|
||||||
$(OUTPUT): $(SOURCE_FILES)
|
$(OUTPUT): $(OBJECT_FILES)
|
||||||
mkdir -p out
|
$(CXX) -shared $^ -o $@
|
||||||
$(CXX) -shared -Wall --no-gnu-unique -fPIC $(SOURCE_FILES) -g `pkg-config --cflags hyprland | awk '{print $$NF "/src";}'` `pkg-config --cflags pixman-1 libdrm hyprland` -std=c++26 -o $(OUTPUT)
|
|
||||||
|
# Compile step (object file per .cpp)
|
||||||
|
out/%.o: ./src/%.cpp
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
$(CXX) $(CXX_FLAGS) -c $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OUTPUT)
|
$(RM) $(OUTPUT) $(OBJECT_FILES)
|
||||||
|
|
||||||
load: all unload
|
load: all unload
|
||||||
hyprctl plugin load ${PWD}/$(OUTPUT)
|
hyprctl plugin load ${PWD}/$(OUTPUT)
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
inherit (hyprland) buildInputs;
|
inherit (hyprland) buildInputs;
|
||||||
nativeBuildInputs = hyprland.nativeBuildInputs ++ [hyprland gcc14];
|
nativeBuildInputs = hyprland.nativeBuildInputs ++ [hyprland gcc14];
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
dontUseCmakeConfigure = true;
|
dontUseCmakeConfigure = true;
|
||||||
dontUseMesonConfigure = true;
|
dontUseMesonConfigure = true;
|
||||||
|
@ -40,7 +41,7 @@
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p "$out/lib"
|
mkdir -p "$out/lib"
|
||||||
cp -r out/* "$out/lib/lib${name}.so"
|
cp -r out/dynamic-cursors.so "$out/lib/lib${name}.so"
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue