From 4fe242a5efee23982e78ec8d9e87bbd376b6e111 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Sun, 30 Nov 2025 10:16:44 -0500 Subject: [PATCH] build(meson): added checks for header compatibility --- meson.build | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 6ed49fea..0ec200b3 100644 --- a/meson.build +++ b/meson.build @@ -31,20 +31,20 @@ message('Found FORTRAN compiler: ' + meson.get_compiler('fortran').get_id()) message('C++ standard set to: ' + get_option('cpp_std')) message('Fortran standard set to: ' + get_option('fortran_std')) +cppc = meson.get_compiler('cpp') -if meson.get_compiler('cpp').get_id() == 'clang' - # We disable these because of CppAD + +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 meson.get_compiler('cpp').get_id() == 'gcc' - # We disable these because of boost notes about abi changes from C++10 -> C++17 make the build too noisey +if cppc.get_id() == 'gcc' message('disabling psabi warnings for gcc') add_project_arguments('-Wno-psabi', language: 'cpp') - if (meson.get_compiler('cpp').version().version_compare('<14.0')) - error('g++ version must be at least 14.0, found ' + meson.get_compiler('cpp').version()) + if (cppc.version().version_compare('<14.0')) + error('g++ version must be at least 14.0, found ' + cppc.version()) endif endif @@ -58,12 +58,20 @@ if (build_fortran) error('The only supported fortran compiler for GridFire is gfortran (version >= 14.0), found ' + fc + '. GridFire has not been tested with any other compilers. You can disable this check with the -Dunsafe-fortran=true flag to try other compilers') endif endif - if (meson.get_compiler('fortran').version().version_compare('<14.0')) - error('gfortran version must be at least 14.0, found ' + meson.get_compiler('fortran').version()) + if (fc.version().version_compare('<14.0')) + error('gfortran version must be at least 14.0, found ' + fc.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 + + # For Eigen