From 64914bdd095119dd008bccd1d4ee58613b246942 Mon Sep 17 00:00:00 2001 From: Karuro Chari Date: Fri, 23 May 2025 09:05:51 +0100 Subject: [PATCH 1/2] Added meson build script --- meson.build | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..4a7ce47b3 --- /dev/null +++ b/meson.build @@ -0,0 +1,30 @@ +project( + 'cppfront', + ['cpp'], + version: files('./source/version.info'), + meson_version: '>= 1.1', + default_options: ['cpp_std=c++20'], +) + +threads_dep = dependency('threads', required : true) + +executable('cppfront', './source/cppfront.cpp', + cpp_args : [ + '-Wall', + '-Wextra', + '-Wold-style-cast', + '-Wunused-parameter', + '-Wpedantic', + '-Werror', + '-Wno-unknown-warning', + '-Wno-unknown-warning-option' + ], + dependencies: [threads_dep], + install:true +) + +install_headers([ + './include/cpp2regex.h', + './include/cpp2regex.h2', + './include/cpp2util.h' +]) From 87f909f985da147bc9d044f018a21249db68d64f Mon Sep 17 00:00:00 2001 From: KaruroChori Date: Fri, 23 May 2025 11:03:27 +0100 Subject: [PATCH 2/2] Update meson.build to use it as a subproject dependency Extended to also cover the use-case in https://github.com/jpakkane/cppfront Signed-off-by: KaruroChori --- meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 4a7ce47b3..c0f018b3b 100644 --- a/meson.build +++ b/meson.build @@ -8,7 +8,7 @@ project( threads_dep = dependency('threads', required : true) -executable('cppfront', './source/cppfront.cpp', +cppfront = executable('cppfront', './source/cppfront.cpp', cpp_args : [ '-Wall', '-Wextra', @@ -28,3 +28,6 @@ install_headers([ './include/cpp2regex.h2', './include/cpp2util.h' ]) + +meson.override_find_program('cppfront', cppfront) +cpp2_dep = declare_dependency(include_directories: 'include')