From a1deef575f1d9503fcc7ec3b36c3f4f53d112a55 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Mon, 4 Mar 2024 12:56:09 +0800 Subject: [PATCH] Use meson build system --- meson.build | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+) create mode 100644 meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..fa36f9aa --- /dev/null +++ b/meson.build @@ -0,0 +1,34 @@ +## Copyright (C) 2024 by LH_Mouse +## +## Permission to use, copy, modify, and/or distribute this +## software for any purpose with or without fee is hereby granted. +## +## THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +## WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +## WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL +## THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +## CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +## LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +## NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +## CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +project('http-parser', 'c', version: '2.9.4') + +# Build and install these +install_headers('http_parser.h') + +libhttp_parser = both_libraries('http_parser', + sources: 'http_parser.c', + c_args: [ '-Wall', '-Wextra', '-fexceptions' ], + soversion: meson.project_version().split('.')[0], + version: meson.project_version(), + install: true) + +libhttp_parser_pc = import('pkgconfig').generate(libhttp_parser, + name: 'http-parser', + url: 'https://github.com/lhmouse/http-parser', + description: 'http request/response parser for c') + +# Run the test +t = executable('self_test', 'test.c', link_with: libhttp_parser) +test('self_test', t)