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

Mingw32 Compile #2268

Merged
merged 2 commits into from
Dec 22, 2016
Merged
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
8 changes: 4 additions & 4 deletions builds/mingw32/Makefile.mingw32
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC=gcc
CFLAGS=-Wall -Os -g -DDLL_EXPORT -DFD_SETSIZE=16384 -DZMQ_USE_SELECT -I.
LIBS=-lws2_32 -lIphlpapi
LIBS=-lws2_32 -lIphlpapi -lsodium
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why hardcoding libsodium? it should work with tweetnacl too and it should be an option


OBJS = ctx.o reaper.o dist.o err.o \
clock.o metadata.o random.o \
Expand All @@ -27,7 +27,7 @@ OBJS = ctx.o reaper.o dist.o err.o \
mechanism.o null_mechanism.o plain_client.o plain_server.o \
socks.o server.o decoder_allocators.o socks_connecter.o \
socket_poller.o mailbox_safe.o plain_server.o client.o timers.o \
zmq.o zmq_utils.o
zmq.o zmq_utils.o gather.o scatter.o dgram.o

%.o: ../../src/%.cpp
$(CC) -c -o $@ $< $(CFLAGS)
Expand All @@ -40,10 +40,10 @@ all: libzmq.dll
perf: inproc_lat.exe inproc_thr.exe local_lat.exe local_thr.exe remote_lat.exe remote_thr.exe

libzmq.dll: $(OBJS)
g++ -shared -o $@ $^ -Wl,--out-implib,$@.a $(LIBS)
g++ -shared -static -O2 -s -o $@ $^ -Wl,--out-implib,$@.a $(LIBS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why hardcoding O2 and s? Usually they are defined by the environment, application makefiles should never explicitly define them


%.exe: %.o libzmq.dll
g++ -o $@ $^
g++ -o -O2 $@ $^

clean:
del *.o *.a *.dll *.exe
2 changes: 2 additions & 0 deletions builds/mingw32/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@

#define ZMQ_HAVE_WINDOWS

#define ZMQ_USE_LIBSODIUM

#endif