From 968084f074d603d025c7f36059a4746137b39dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 11 Nov 2018 13:07:48 +0100 Subject: [PATCH] Remove the default dependency to libanl. Fixes #78. The dependency wasn't used at all, but is now optionally used through the epoll-gaia configuration. --- dub.sdl | 10 +++++++++- source/eventcore/drivers/posix/driver.d | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dub.sdl b/dub.sdl index be18279..91adf3f 100644 --- a/dub.sdl +++ b/dub.sdl @@ -5,7 +5,7 @@ copyright "Copyright © 2016-2018 Sönke Ludwig" targetType "library" -libs "anl" "resolv" platform="linux" +libs "resolv" platform="linux" libs "ws2_32" "user32" platform="windows-dmd" dependency "taggedalgebraic" version="~>0.10.12" @@ -15,6 +15,14 @@ configuration "epoll" { versions "EventcoreEpollDriver" } +// getaddrinfo_a based DNS lookups +configuration "epoll-gaia" { + libs "anl" + versions "EventcoreUseGAIA" + platforms "linux" + versions "EventcoreEpollDriver" +} + configuration "kqueue" { platforms "osx" "freebsd" versions "EventcoreKqueueDriver" diff --git a/source/eventcore/drivers/posix/driver.d b/source/eventcore/drivers/posix/driver.d index 2815fff..bd41642 100644 --- a/source/eventcore/drivers/posix/driver.d +++ b/source/eventcore/drivers/posix/driver.d @@ -45,7 +45,7 @@ final class PosixEventDriver(Loop : PosixEventLoop) : EventDriver { alias TimerDriver = LoopTimeoutTimerDriver; alias SocketsDriver = PosixEventDriverSockets!Loop; version (Windows) alias DNSDriver = EventDriverDNS_GHBN!(EventsDriver, SignalsDriver); - //version (linux) alias DNSDriver = EventDriverDNS_GAIA!(EventsDriver, SignalsDriver); + else version (EventcoreUseGAIA) alias DNSDriver = EventDriverDNS_GAIA!(EventsDriver, SignalsDriver); else alias DNSDriver = EventDriverDNS_GAI!(EventsDriver, SignalsDriver); alias FileDriver = ThreadedFileEventDriver!EventsDriver; version (linux) alias WatcherDriver = InotifyEventDriverWatchers!EventsDriver;