|
| 1 | +-- Form B header-only descriptor for cpp-httplib. Optional backends stay off |
| 2 | +-- unless a consumer requests the corresponding mcpp feature. |
| 3 | +package = { |
| 4 | + spec = "1", |
| 5 | + namespace = "compat", |
| 6 | + name = "httplib", |
| 7 | + description = "C++ single-header HTTP/HTTPS server and client library", |
| 8 | + licenses = {"MIT"}, |
| 9 | + repo = "https://github.com/yhirose/cpp-httplib", |
| 10 | + type = "package", |
| 11 | + |
| 12 | + xpm = { |
| 13 | + -- No mcpp-res credentials are available in this environment. Keep the |
| 14 | + -- GLOBAL URL as a plain string until a byte-identical CN asset exists. |
| 15 | + linux = { |
| 16 | + ["0.53.1"] = { |
| 17 | + url = "https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.53.1.tar.gz", |
| 18 | + sha256 = "185af9587e270de9a3bfee234c6740f02e82265da33c7a41f97e02ee42f979d2", |
| 19 | + }, |
| 20 | + }, |
| 21 | + macosx = { |
| 22 | + ["0.53.1"] = { |
| 23 | + url = "https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.53.1.tar.gz", |
| 24 | + sha256 = "185af9587e270de9a3bfee234c6740f02e82265da33c7a41f97e02ee42f979d2", |
| 25 | + }, |
| 26 | + }, |
| 27 | + windows = { |
| 28 | + ["0.53.1"] = { |
| 29 | + url = "https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.53.1.tar.gz", |
| 30 | + sha256 = "185af9587e270de9a3bfee234c6740f02e82265da33c7a41f97e02ee42f979d2", |
| 31 | + }, |
| 32 | + }, |
| 33 | + }, |
| 34 | + |
| 35 | + mcpp = { |
| 36 | + language = "c++23", |
| 37 | + import_std = false, |
| 38 | + include_dirs = { "*" }, |
| 39 | + generated_files = { |
| 40 | + ["mcpp_generated/compat_httplib_anchor.cpp"] = |
| 41 | + "int mcpp_compat_httplib_anchor(void) { return 0; }\n", |
| 42 | + }, |
| 43 | + sources = { "mcpp_generated/compat_httplib_anchor.cpp" }, |
| 44 | + targets = { ["httplib"] = { kind = "lib" } }, |
| 45 | + |
| 46 | + -- Feature defines are interface requirements for this header-only |
| 47 | + -- package: cpp-httplib's implementation is compiled in consumer TUs. |
| 48 | + features = { |
| 49 | + ["tls"] = { |
| 50 | + defines = { "CPPHTTPLIB_OPENSSL_SUPPORT" }, |
| 51 | + deps = { ["compat.openssl"] = "3.5.1" }, |
| 52 | + }, |
| 53 | + ["zlib"] = { |
| 54 | + defines = { "CPPHTTPLIB_ZLIB_SUPPORT" }, |
| 55 | + deps = { ["compat.zlib"] = "1.3.2" }, |
| 56 | + }, |
| 57 | + ["brotli"] = { |
| 58 | + defines = { "CPPHTTPLIB_BROTLI_SUPPORT" }, |
| 59 | + deps = { ["compat.brotli"] = "1.2.0" }, |
| 60 | + }, |
| 61 | + ["zstd"] = { |
| 62 | + defines = { "CPPHTTPLIB_ZSTD_SUPPORT" }, |
| 63 | + deps = { ["compat.zstd"] = "1.5.7" }, |
| 64 | + }, |
| 65 | + ["no-exceptions"] = { |
| 66 | + defines = { "CPPHTTPLIB_NO_EXCEPTIONS" }, |
| 67 | + }, |
| 68 | + }, |
| 69 | + deps = {}, |
| 70 | + |
| 71 | + -- Feature entries cannot carry platform-local ldflags. These are the |
| 72 | + -- upstream target's system link requirements; unused system libraries |
| 73 | + -- and frameworks are harmless for feature-free consumers. |
| 74 | + linux = { |
| 75 | + ldflags = { "-lpthread" }, |
| 76 | + }, |
| 77 | + macosx = { |
| 78 | + ldflags = { |
| 79 | + "-lpthread", |
| 80 | + "-framework", "CFNetwork", |
| 81 | + "-framework", "CoreFoundation", |
| 82 | + "-framework", "Security", |
| 83 | + }, |
| 84 | + }, |
| 85 | + windows = { |
| 86 | + ldflags = { "-lws2_32", "-lcrypt32" }, |
| 87 | + }, |
| 88 | + }, |
| 89 | +} |
0 commit comments