Polishing pass, gmake is required on MacOS, use pkg-config, revert msgenc Makefile changes

This commit is contained in:
shinyquagsire23 2021-11-05 11:25:59 -07:00
parent f192e7afe7
commit 8fb8ac2665
5 changed files with 13 additions and 7 deletions

2
.gitignore vendored
View File

@ -68,4 +68,4 @@ cmake-build-*
*.dSYM
# MacOS garbage
.DS_Store
.DS_Store

View File

@ -64,6 +64,7 @@ macOS 10.15 Catalina and later is supported on Intel and ARM64 hardware configur
* arm-gcc-bin
* git
* libpng
* pkg-config
* wine-crossover (includes wine32on64, required on Catalina and later to run 32-bit x86 EXEs)
They can be installed with the following commands:
@ -71,7 +72,7 @@ They can be installed with the following commands:
```console
$ brew tap osx-cross/homebrew-arm
$ brew tap gcenx/wine
$ brew install coreutils make gnu-sed llvm arm-gcc-bin libpng git
$ brew install coreutils make gnu-sed llvm arm-gcc-bin libpng git pkg-config
$ brew install wine-crossover
```
@ -99,9 +100,9 @@ Note: Docker may not run at a full performance if its underlying Linux kernel is
#### macOS
To avoid issues, you may need to run the build as shown below. This avoids issues with missing features (i.e. "introduced in macOS 10.15" errors) and Apple's `make` being an older version.
To avoid issues, you will need to run the build as shown below. This avoids issues with missing features (i.e. "introduced in macOS 10.15" errors) and Apple's `make` being an older version.
```console
$ export PATH=$HOMEBREW_PREFIX/opt/llvm/bin:$PATH CC=clang CXX=clang++
$ export PATH=${HOMEBREW_PREFIX}/opt/llvm/bin:$PATH CC=clang CXX=clang++
$ gmake
```

View File

@ -8,7 +8,7 @@ else
C_SRCS :=
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -lstdc++ -lc++ -lc
LDFLAGS += -lstdc++ -lc++ -lc -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM
else
LDFLAGS += -lstdc++fs
endif

View File

@ -8,7 +8,12 @@ endif
DEPDIR := .deps
DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.d
SRCS := msgenc.cpp MessagesConverter.cpp MessagesDecoder.cpp MessagesEncoder.cpp
define SRCS :=
msgenc.cpp
MessagesConverter.cpp
MessagesDecoder.cpp
MessagesEncoder.cpp
endef
OBJS := $(SRCS:%.cpp=%.o)

View File

@ -4,7 +4,7 @@ CFLAGS = -Wall -Wextra -Werror -Wno-sign-compare -std=c11 -O2 -DPNG_SKIP_SETJMP_
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CFLAGS += -I $(HOMEBREW_PREFIX)/opt/libpng/include -L $(HOMEBREW_PREFIX)/opt/libpng/lib
CFLAGS += $(shell pkg-config --cflags libpng) $(shell pkg-config --libs libpng)
endif
LIBS = -lpng -lz