From 3174c83b43739995d119aa372d6a5f6d45b27b9e Mon Sep 17 00:00:00 2001 From: Steffen Winter Date: Mon, 15 Jan 2024 19:17:05 +0100 Subject: [PATCH] -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. --- CMakeLists.txt | 1 + Makefile | 2 +- src/btop.cpp | 1 + src/btop_tools.hpp | 4 +--- 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 $<$:_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;