Skip to content

Commit 6d9a7d1

Browse files
committed
[make] Fix library suffix on windows
1 parent f824840 commit 6d9a7d1

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
test/
2-
*.so
2+
*.so
3+
*.dll

Makefile

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,28 @@ LIBS_PATH = -L$(LUA_LIBDIR)
44
LIBS = -lpthread
55
FLAGS = -std=c++11 -Wall $(LIBFLAG) $(CFLAGS)
66

7-
all: simdjson.so
7+
ifeq ($(OS),Windows_NT)
8+
LIBEXT = dll
9+
else
10+
UNAME := $(shell uname -s)
11+
ifeq ($(findstring MINGW,$(UNAME)),MINGW)
12+
LIBEXT = dll
13+
else ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
14+
LIBEXT = dll
15+
else
16+
LIBEXT = so
17+
endif
18+
endif
819

9-
simdjson.so:
20+
TARGET = simdjson.$(LIBEXT)
21+
22+
all: $(TARGET)
23+
24+
$(TARGET):
1025
$(CXX) $(SRC) $(FLAGS) $(INCLUDE) $(LIBS_PATH) $(LIBS) -o $@
1126

1227
clean:
13-
rm *.so
28+
rm *.$(LIBEXT)
1429

15-
install: simdjson.so
16-
cp simdjson.so $(INST_LIBDIR)
30+
install: $(TARGET)
31+
cp $(TARGET) $(INST_LIBDIR)

0 commit comments

Comments
 (0)