summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Winter <steffen.winter@proton.me>2024-01-15 19:17:05 +0100
committerSteffen Winter <steffen.winter@proton.me>2024-01-17 09:56:18 +0100
commit3174c83b43739995d119aa372d6a5f6d45b27b9e (patch)
tree020991cb2271a29fbdb0dfb832eb0d9955409a19
parentb2df50396b0405b8ce2cfa3b10d4542cfd9d73cd (diff)
-DFMT_HEADER_ONLY as a compiler flag
This just defines FMT_HEADER_ONLY everywhere instead of just in all files that include `btop_tools.hpp`, in case the statement gets removed there.
-rw-r--r--CMakeLists.txt1
-rw-r--r--Makefile2
-rw-r--r--src/btop.cpp1
-rw-r--r--src/btop_tools.hpp4
4 files changed, 4 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cd39946..df8d347 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,6 +110,7 @@ if(HAS_FCF_PROTECTION)
endif()
target_compile_definitions(btop PRIVATE
+ FMT_HEADER_ONLY
_FILE_OFFSET_BITS=64
$<$<CONFIG:Debug>:_GLIBCXX_ASSERTIONS _LIBCPP_ENABLE_ASSERTIONS=1>
# Only has an effect with optimizations enabled
diff --git a/Makefile b/Makefile
index ed80899..3aae5d6 100644
--- a/Makefile
+++ b/Makefile
@@ -179,7 +179,7 @@ override GOODFLAGS := $(foreach flag,$(TESTFLAGS),$(strip $(shell echo "int main
override REQFLAGS := -std=c++20
WARNFLAGS := -Wall -Wextra -pedantic
OPTFLAGS := -O2 -ftree-vectorize -flto=$(LTO)
-LDCXXFLAGS := -pthread -D_GLIBCXX_ASSERTIONS -D_FILE_OFFSET_BITS=64 $(GOODFLAGS) $(ADDFLAGS)
+LDCXXFLAGS := -pthread -DFMT_HEADER_ONLY -D_GLIBCXX_ASSERTIONS -D_FILE_OFFSET_BITS=64 $(GOODFLAGS) $(ADDFLAGS)
override CXXFLAGS += $(REQFLAGS) $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
override LDFLAGS += $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
INC := $(foreach incdir,$(INCDIRS),-isystem $(incdir)) -I$(SRCDIR)
diff --git a/src/btop.cpp b/src/btop.cpp
index 736854f..aac8e9c 100644
--- a/src/btop.cpp
+++ b/src/btop.cpp
@@ -53,6 +53,7 @@ tab-size = 4
#include "btop_draw.hpp"
#include "btop_menu.hpp"
#include "fmt/core.h"
+#include "fmt/ostream.h"
using std::atomic;
using std::cout;
diff --git a/src/btop_tools.hpp b/src/btop_tools.hpp
index 705a5eb..708fddf 100644
--- a/src/btop_tools.hpp
+++ b/src/btop_tools.hpp
@@ -42,11 +42,9 @@ tab-size = 4
#define HOST_NAME_MAX 64
#endif
#endif
-#define FMT_HEADER_ONLY
+
#include "fmt/core.h"
#include "fmt/format.h"
-#include "fmt/ostream.h"
-#include "fmt/ranges.h"
using std::array;
using std::atomic;