Skip to content

Commit

Permalink
Asio (#158)
Browse files Browse the repository at this point in the history
* Add initial ASIO support

* Fix a few issues, pass hammer_test with ASIO

* Fix ASIO timer, async, remove prints

* Make it more obvious we fallthrough on no us polls
  • Loading branch information
uNetworkingAB authored Sep 4, 2021
1 parent 18debf8 commit f6b00aa
Show file tree
Hide file tree
Showing 7 changed files with 502 additions and 2 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ ifeq ($(WITH_LIBUV),1)
override LDFLAGS += -luv
endif

# WITH_ASIO builds with boot asio event-loop
ifeq ($(WITH_ASIO),1)
override CFLAGS += -DLIBUS_USE_ASIO
override LDFLAGS += -lstdc++ -lpthread
override CXXFLAGS += -pthread -DLIBUS_USE_ASIO
endif

# WITH_GCD=1 builds with libdispatch as event-loop
ifeq ($(WITH_GCD),1)
override CFLAGS += -DLIBUS_USE_GCD
Expand All @@ -40,6 +47,11 @@ override LDFLAGS += uSockets.a
default:
rm -f *.o
$(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c
# Also link in Boost Asio support
ifeq ($(WITH_ASIO),1)
$(CXX) $(CXXFLAGS) -Isrc -std=c++14 -flto -O3 -c src/eventing/asio.cpp
endif

# For now we do rely on C++17 for OpenSSL support but we will be porting this work to C11
ifeq ($(WITH_OPENSSL),1)
$(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp
Expand Down
Loading

0 comments on commit f6b00aa

Please sign in to comment.