1# Copyright 2016 Google Inc. 2# 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6declare_args() { 7} 8 9import("../third_party.gni") 10 11third_party("libmicrohttpd") { 12 public_include_dirs = [ "../externals/microhttpd/src/include" ] 13 14 include_dirs = [ "." ] 15 sources = [ 16 "../externals/microhttpd/src/microhttpd/base64.c", 17 "../externals/microhttpd/src/microhttpd/connection.c", 18 "../externals/microhttpd/src/microhttpd/daemon.c", 19 "../externals/microhttpd/src/microhttpd/internal.c", 20 "../externals/microhttpd/src/microhttpd/memorypool.c", 21 "../externals/microhttpd/src/microhttpd/postprocessor.c", 22 "../externals/microhttpd/src/microhttpd/reason_phrase.c", 23 "../externals/microhttpd/src/microhttpd/response.c", 24 "../externals/microhttpd/src/microhttpd/tsearch.c", 25 ] 26 27 defines = [ "DAUTH_SUPPORT=1" ] 28 libs = [] 29 _is_msvc = is_win && !is_clang 30 if (!_is_msvc) { 31 cflags = [ "-Wno-implicit-function-declaration" ] 32 } 33 34 if (is_win) { 35 sources += [ "../externals/microhttpd/src/platform/w32functions.c" ] 36 defines += [ 37 "HAVE_SYS_TYPES_H=1", 38 "HAVE_TIME_H=1", 39 "MHD_USE_W32_THREADS=1", 40 "WINDOWS", 41 ] 42 libs += [ "Ws2_32.lib" ] 43 } else { 44 defines += [ 45 "HAVE_NETINET_IN_H=1", 46 "HAVE_PTHREAD_H=1", 47 "HAVE_SYS_SOCKET_H=1", 48 "MHD_USE_POSIX_THREADS=1", 49 ] 50 } 51} 52