Skip to content

Commit

Permalink
Fixed Mac compillation, -lstdc++fs flag adds only on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Yermoshenko committed May 13, 2021
1 parent 9fc1581 commit 17e0f33
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ZOPFLIPNG_OBJ := lib/zopflipng/lodepng/lodepng.o lib/zopflipng/lodepng/lodepng
CFLAGS += -Wall -Wextra -Wno-unused-parameter -Werror -O3 -msse2 -mfpmath=sse -flto
CPPFLAGS += -I./lib
CXXFLAGS += $(CFLAGS) -std=c++17 -fno-rtti
LDFLAGS += -flto -lpthread -lstdc++fs
LDFLAGS += -flto -lpthread

ifeq ($(OS), Windows_NT)
SYSTEM := Windows
Expand All @@ -22,6 +22,11 @@ ifeq ($(SYSTEM), Linux)
LDFLAGS += -fuse-ld=gold
endif

# -lstdc++fs supported only on Linux
ifeq ($(SYSTEM), Linux)
LDFLAGS += -lstdc++fs
endif

ifeq ($(SYSTEM), Darwin)
LDLIBS += -liconv
else
Expand Down

0 comments on commit 17e0f33

Please sign in to comment.