Skip to content

Commit

Permalink
makefile: fix workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni500github committed Sep 15, 2024
1 parent e57dfb1 commit bfb2dd1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
8 changes: 7 additions & 1 deletion compile_flags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
8 changes: 4 additions & 4 deletions src/query/unix/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "switch_fnv1a.hpp"
#include "util.hpp"

#if USE_GLIB
# include <dconf/client/dconf-client.h>
#if USE_DCONF
# include <client/dconf-client.h>
# include <glib/gvariant.h>
#endif

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bfb2dd1

Please sign in to comment.