Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/fmt: New library #601

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@
[submodule "lib/usb/libusbohci"]
path = lib/usb/libusbohci
url = https://github.com/XboxDev/libusbohci.git
[submodule "lib/fmt/fmt"]
path = lib/fmt/fmt
url = https://github.com/glebm/fmt.git
branch = nxdk
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ QUIET=>/dev/null
endif

DEPS := $(filter %.c.d, $(SRCS:.c=.c.d))
DEPS += $(filter %.cc.d, $(SRCS:.cc=.cc.d))
DEPS += $(filter %.cpp.d, $(SRCS:.cpp=.cpp.d))

$(OUTPUT_DIR)/default.xbe: main.exe $(OUTPUT_DIR) $(CXBE)
Expand Down Expand Up @@ -128,6 +129,10 @@ endif
@echo "[ CXX ] $@"
$(VE) $(CXX) $(NXDK_CXXFLAGS) $(CXXFLAGS) -MD -MP -MT '$@' -MF '$(patsubst %.obj,%.cpp.d,$@)' -c -o '$@' '$<'

%.obj: %.cc
@echo "[ CXX ] $@"
$(VE) $(CXX) $(NXDK_CXXFLAGS) $(CXXFLAGS) -MD -MP -MT '$@' -MF '$(patsubst %.obj,%.cc.d,$@)' -c -o '$@' '$<'

%.obj: %.c
@echo "[ CC ] $@"
$(VE) $(CC) $(NXDK_CFLAGS) $(CFLAGS) -MD -MP -MT '$@' -MF '$(patsubst %.obj,%.c.d,$@)' -c -o '$@' '$<'
Expand Down
1 change: 1 addition & 0 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ include $(NXDK_DIR)/lib/xboxrt/Makefile
include $(NXDK_DIR)/lib/zlib/Makefile
include $(NXDK_DIR)/lib/libpng/Makefile
include $(NXDK_DIR)/lib/libjpeg/Makefile
include $(NXDK_DIR)/lib/fmt/Makefile
18 changes: 18 additions & 0 deletions lib/fmt/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FMT_DIR = $(NXDK_DIR)/lib/fmt/fmt

FMT_SRCS = $(FMT_DIR)/src/format.cc \
$(FMT_DIR)/src/os.cc

FMT_OBJS = $(addsuffix .obj, $(basename $(FMT_SRCS)))

NXDK_CXXFLAGS += -I$(FMT_DIR)/include -I$(FMT_DIR)/src

$(NXDK_DIR)/lib/fmt.lib: $(FMT_OBJS)

main.exe: $(NXDK_DIR)/lib/fmt.lib

CLEANRULES += clean-fmt

.PHONY: clean-fmt
clean-fmt:
$(VE)rm -f $(FMT_OBJS) $(NXDK_DIR)/lib/fmt.lib
1 change: 1 addition & 0 deletions lib/fmt/fmt
Submodule fmt added at 49061d
5 changes: 5 additions & 0 deletions lib/pkgconfig/fmt.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Name: fmt
Description: A modern formatting library
Version: 8.1.1
Libs: ${NXDK_DIR}/lib/fmt.lib
Cflags: -I${NXDK_DIR}/lib/fmt/fmt/include