From bfb2dd19bc89bce24623e3507bdcc3cd80539b72 Mon Sep 17 00:00:00 2001 From: Toni500git Date: Sun, 15 Sep 2024 14:25:09 +0200 Subject: [PATCH] makefile: fix workflows --- Makefile | 18 +++++++++--------- compile_flags.txt | 8 +++++++- src/query/unix/theme.cpp | 8 ++++---- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index e3e3485..0851b63 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ GUI_MODE ?= 0 VENDOR_TEST ?= 0 DEVICE_TEST ?= 0 -USE_GLIB ?= 1 +USE_DCONF ?= 1 # https://stackoverflow.com/a/1079861 # WAY easier way to build debug and release builds ifeq ($(DEBUG), 1) @@ -39,6 +39,14 @@ ifeq ($(GUI_MODE), 1) CXXFLAGS += `pkg-config --cflags gtkmm-3.0` endif +ifeq ($(USE_DCONF), 1) + ifeq ($(shell pkg-config --exists glib-2.0 dconf && echo 1), 1) + CXXFLAGS += -DUSE_DCONF=1 `pkg-config --cflags glib-2.0 dconf` + else + CXXFLAGS += -DUSE_DCONF=0 + endif +endif + NAME = customfetch TARGET = cufetch OLDVERSION = 0.9.2 @@ -50,14 +58,6 @@ LDFLAGS += -L./$(BUILDDIR)/fmt -lfmt -ldl CXXFLAGS ?= -mtune=generic -march=native CXXFLAGS += -fvisibility=hidden -Iinclude -std=c++20 $(VARS) -DVERSION=\"$(VERSION)\" -DBRANCH=\"$(BRANCH)\" -ifeq ($(USE_GLIB), 1) - ifeq ($(shell pkg-config --exists glib-2.0 && echo 1 || echo 0), 1) - CXXFLAGS += -DUSE_GLIB=1 `pkg-config --cflags glib-2.0` - else - CXXFLAGS += -DUSE_GLIB=0 - endif -endif - all: fmt toml $(TARGET) fmt: diff --git a/compile_flags.txt b/compile_flags.txt index 196cc33..1ba0deb 100644 --- a/compile_flags.txt +++ b/compile_flags.txt @@ -6,7 +6,7 @@ -DVERSION="0.9.3" -DBRANCH="main" -DGUI_MODE=1 --DUSE_GLIB=1 +-DUSE_DCONF=1 -DDEBUG=1 -I/usr/include/gtkmm-3.0 -I/usr/lib/gtkmm-3.0/include @@ -47,3 +47,9 @@ -I/usr/lib/dbus-1.0/include -I/usr/include/fribidi -I/usr/include/gio-unix-2.0 +-I/usr/include/dconf +-I/usr/include/glib-2.0 +-I/usr/lib/glib-2.0/include +-I/usr/include/libmount +-I/usr/include/blkid +-I/usr/include/sysprof-6 diff --git a/src/query/unix/theme.cpp b/src/query/unix/theme.cpp index 611673b..2345f4b 100644 --- a/src/query/unix/theme.cpp +++ b/src/query/unix/theme.cpp @@ -8,8 +8,8 @@ #include "switch_fnv1a.hpp" #include "util.hpp" -#if USE_GLIB -# include +#if USE_DCONF +# include # include #endif @@ -97,7 +97,7 @@ static bool get_cursor_xresources(Theme::Theme_t& theme) static bool get_cursor_dconf(const std::string_view de_name, Theme::Theme_t& theme) { -#if USE_GLIB +#if USE_DCONF LOAD_LIBRARY("libdconf.so", return false); LOAD_LIB_SYMBOL(DConfClient *, dconf_client_new, void); @@ -281,7 +281,7 @@ static bool get_gtk_theme_config(const std::string_view path, Theme::Theme_t& th static bool get_gtk_theme_dconf(const std::string_view de_name, Theme::Theme_t& theme) { -#if USE_GLIB +#if USE_DCONF LOAD_LIBRARY("libdconf.so", return false); LOAD_LIB_SYMBOL(DConfClient *, dconf_client_new, void);