From d19a5ae36d674d47c224feb1be91715e3d92aa6e Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Sat, 31 Jan 2026 10:12:52 -0500 Subject: [PATCH] feat(build-check): added setup checks for stl compatibility build-check checks for print and format headers from stl --- build-check/CPPC/meson.build | 22 ++++++++++++++++++++++ build-check/meson.build | 14 ++++++++++++++ meson.build | 2 ++ 3 files changed, 38 insertions(+) create mode 100644 build-check/CPPC/meson.build create mode 100644 build-check/meson.build diff --git a/build-check/CPPC/meson.build b/build-check/CPPC/meson.build new file mode 100644 index 0000000..fbda39d --- /dev/null +++ b/build-check/CPPC/meson.build @@ -0,0 +1,22 @@ +cppc = meson.get_compiler('cpp') + +if cppc.get_id() == 'clang' + message('disabling bitwise-instead-of-logical warnings for clang') + add_project_arguments('-Wno-bitwise-instead-of-logical', language: 'cpp') +endif + +if cppc.get_id() == 'gcc' + message('disabling psabi warnings for gcc') + add_project_arguments('-Wno-psabi', language: 'cpp') + + if (cppc.version().version_compare('<14.0')) + error('g++ version must be at least 14.0, found ' + cppc.version()) + endif +endif + +if not cppc.has_header('print') + error('C++ standard library header not found. Please ensure your compiler and standard library supports C++23. We have already validated your compiler version so this is likely an issue with your standard library installation.') +endif +if not cppc.has_header('format') + error('C++ standard library header not found. Please ensure your compiler and standard library supports C++23. We have already validated your compiler version so this is likely an issue with your standard library installation.') +endif diff --git a/build-check/meson.build b/build-check/meson.build new file mode 100644 index 0000000..4c0c1a5 --- /dev/null +++ b/build-check/meson.build @@ -0,0 +1,14 @@ +message('Found CXX compiler: ' + meson.get_compiler('cpp').get_id()) +message('C++ standard set to: ' + get_option('cpp_std')) + +cc = meson.get_compiler('c') + +ignore_unused_args = '-Wno-unused-command-line-argument' + +add_global_arguments(ignore_unused_args, language: 'cpp') +add_global_arguments(ignore_unused_args, language: 'c') + + +subdir('CPPC') + + diff --git a/meson.build b/meson.build index 6669d1a..fd798b3 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,7 @@ project('stroid', 'cpp', meson_version : '>= 1.3.0', version : 'v0.1.0', default_options : ['cpp_std=c++23']) +subdir('build-check') + subdir('build-config') subdir('src')