mirror of https://github.com/aristocratos/btop.git
Pass -DFMT_HEADER_ONLY as a compiler flag
Moving the definition of the FMT_HEADER_ONLY macro from a file to the compiler makes all code relying on this macro independent of a single file Also cleanup some unused fmt includes
This commit is contained in:
parent
d48f722eb9
commit
310d96443c
|
@ -131,6 +131,7 @@ target_compile_definitions(btop PRIVATE
|
|||
_GLIBCXX_ASSERTIONS _LIBCPP_ENABLE_ASSERTIONS=1
|
||||
# Only has an effect with optimizations enabled
|
||||
$<$<NOT:$<CONFIG:Debug>>:_FORTIFY_SOURCE=2>
|
||||
FMT_HEADER_ONLY
|
||||
)
|
||||
|
||||
# Enable GPU support
|
||||
|
|
2
Makefile
2
Makefile
|
@ -183,7 +183,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_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -D_FILE_OFFSET_BITS=64 $(GOODFLAGS) $(ADDFLAGS)
|
||||
LDCXXFLAGS := -pthread -DFMT_HEADER_ONLY -D_FORTIFY_SOURCE=2 -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)
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <string_view>
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/ostream.h>
|
||||
|
||||
#include "btop_shared.hpp"
|
||||
#include "btop_tools.hpp"
|
||||
|
|
|
@ -38,11 +38,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;
|
||||
|
|
Loading…
Reference in New Issue