mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 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 | |
| 6 | declare_args() { |
| 7 | } |
| 8 | |
| 9 | import("../third_party.gni") |
| 10 | |
| 11 | third_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", |
Mike Klein | 2148052 | 2016-10-12 12:20:25 -0400 | [diff] [blame] | 24 | "../externals/microhttpd/src/microhttpd/tsearch.c", |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 25 | ] |
| 26 | |
| 27 | defines = [ "DAUTH_SUPPORT=1" ] |
Mike Klein | 2148052 | 2016-10-12 12:20:25 -0400 | [diff] [blame] | 28 | libs = [] |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 29 | |
Mike Klein | 2148052 | 2016-10-12 12:20:25 -0400 | [diff] [blame] | 30 | if (is_win) { |
| 31 | sources += [ "../externals/microhttpd/src/platform/w32functions.c" ] |
Mike Klein | 0f61faa | 2016-10-11 16:26:57 -0400 | [diff] [blame] | 32 | defines += [ |
| 33 | "HAVE_SYS_TYPES_H=1", |
| 34 | "HAVE_TIME_H=1", |
| 35 | "MHD_USE_W32_THREADS=1", |
| 36 | "WINDOWS", |
| 37 | ] |
Mike Klein | 2148052 | 2016-10-12 12:20:25 -0400 | [diff] [blame] | 38 | libs += [ "Ws2_32.lib" ] |
| 39 | } else { |
| 40 | defines += [ |
| 41 | "HAVE_NETINET_IN_H=1", |
| 42 | "HAVE_PTHREAD_H=1", |
| 43 | "HAVE_SYS_SOCKET_H=1", |
| 44 | "MHD_USE_POSIX_THREADS=1", |
| 45 | ] |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 46 | } |
| 47 | } |