From 0fc425538677d2c644d2f913e911bc30896192b7 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sat, 24 Aug 2024 16:00:44 +0000 Subject: [PATCH 1/2] BLD: Add fmt,tomlpp subprojects --- meson.build | 10 ++++++++-- subprojects/fmt.wrap | 13 +++++++++++++ subprojects/tomlplusplus.wrap | 10 ++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 subprojects/fmt.wrap create mode 100644 subprojects/tomlplusplus.wrap diff --git a/meson.build b/meson.build index 4de3421..f53cef6 100644 --- a/meson.build +++ b/meson.build @@ -11,7 +11,13 @@ _args = [] # Extra arguments _incdir += include_directories('include') -_deps += [dependency('fmt'), dependency('tomlplusplus')] + +fmt_subproj = subproject('fmt', default_options: ['default_library=static']) +_deps += fmt_subproj.get_variable('fmt_dep') + +tomlplusplus_subproj = subproject('tomlplusplus', default_options: ['default_library=static']) +_deps += tomlplusplus_subproj.get_variable('tomlplusplus_dep') + _args += cppc.get_supported_arguments(['-Wno-unused-local-typedefs', '-Wno-array-bounds']) sources_seldon = [ @@ -85,4 +91,4 @@ if get_option('build_tests') ) test(t.get(0), exe, workdir : meson.project_source_root()) endforeach -endif \ No newline at end of file +endif diff --git a/subprojects/fmt.wrap b/subprojects/fmt.wrap new file mode 100644 index 0000000..42b6159 --- /dev/null +++ b/subprojects/fmt.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = fmt-11.0.1 +source_url = https://github.com/fmtlib/fmt/archive/11.0.1.tar.gz +source_filename = fmt-11.0.1.tar.gz +source_hash = 7d009f7f89ac84c0a83f79ed602463d092fbf66763766a907c97fd02b100f5e9 +patch_filename = fmt_11.0.1-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/fmt_11.0.1-1/get_patch +patch_hash = 0a8b93d1ee6d84a82d3872a9bfb4c3977d8a53f7f484d42d1f7ed63ed496d549 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_11.0.1-1/fmt-11.0.1.tar.gz +wrapdb_version = 11.0.1-1 + +[provide] +fmt = fmt_dep diff --git a/subprojects/tomlplusplus.wrap b/subprojects/tomlplusplus.wrap new file mode 100644 index 0000000..97ff296 --- /dev/null +++ b/subprojects/tomlplusplus.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = tomlplusplus-3.4.0 +source_url = https://github.com/marzer/tomlplusplus/archive/v3.4.0.tar.gz +source_filename = tomlplusplus-3.4.0.tar.gz +source_hash = 8517f65938a4faae9ccf8ebb36631a38c1cadfb5efa85d9a72e15b9e97d25155 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/tomlplusplus_3.4.0-1/tomlplusplus-3.4.0.tar.gz +wrapdb_version = 3.4.0-1 + +[provide] +dependency_names = tomlplusplus From a07a30c04b567aad0658e439470475bf5ffacf52 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sat, 24 Aug 2024 16:26:16 +0000 Subject: [PATCH 2/2] BLD: Add and use argparse for build_exe Co-authored-by: User-DK --- .gitignore | 5 +++++ meson.build | 1 + subprojects/argparse.wrap | 13 +++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 subprojects/argparse.wrap diff --git a/.gitignore b/.gitignore index d7df516..2fcccd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +# We can store explicitly what we need +/subprojects/ +!/subprojects/fmt.wrap +!/subprojects/argparse.wrap +!/subprojects/tomlplusplus.wrap *.txt .cache/ diff --git a/meson.build b/meson.build index f53cef6..aa37022 100644 --- a/meson.build +++ b/meson.build @@ -57,6 +57,7 @@ seldon_shared_dep = declare_dependency(include_directories : _incdir, # ------------------------------------ if get_option('build_exe') + _deps += subproject('argparse').get_variable('argparse_dep') exe = executable('seldon', sources_seldon + 'src/main.cpp', install : true, dependencies : _deps, diff --git a/subprojects/argparse.wrap b/subprojects/argparse.wrap new file mode 100644 index 0000000..4d3c1ec --- /dev/null +++ b/subprojects/argparse.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = argparse-3.0 +source_url = https://github.com/p-ranav/argparse/archive/refs/tags/v3.0.tar.gz +source_filename = argparse-3.0.tar.gz +source_hash = ba7b465759bb01069d57302855eaf4d1f7d677f21ad7b0b00b92939645c30f47 +patch_filename = argparse_3.0-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/argparse_3.0-1/get_patch +patch_hash = f83ed766f07c830d3922676c67959f2078a055c07bd360f19e0e114d375d1037 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/argparse_3.0-1/argparse-3.0.tar.gz +wrapdb_version = 3.0-1 + +[provide] +argparse = argparse_dep