36 lines
1.6 KiB
Meson
36 lines
1.6 KiB
Meson
message('C compiler: ' + cc.get_id())
|
|
message('C++ compiler: ' + cpp.get_id())
|
|
|
|
if not cpp.has_header('memory') or not cpp.compiles('''
|
|
#include <type_traits>
|
|
int main() { static_assert(__cplusplus >= 201703L); return 0; }
|
|
''', name: 'C++17 language support')
|
|
error('MFEM 4.10 requires a C++17-or-newer compiler.')
|
|
endif
|
|
|
|
if not cpp.links('''
|
|
#include <print>
|
|
int main() { std::println("SERiF"); }
|
|
''', args: platform_cpp_args + platform_link_args, name: 'C++23 std::println support')
|
|
error('SERiF requires C++23 std::println support. On macOS, use -Dmacos_deployment_target=15.0 or newer with a recent Xcode toolchain.')
|
|
endif
|
|
|
|
if not cpp.compiles('''
|
|
#include <format>
|
|
int main() {
|
|
static_assert(__cpp_static_assert >= 202306L);
|
|
static_assert(false, std::format("C++26 static asserts {}", "supported"));
|
|
return 0;
|
|
}
|
|
''', name: 'C++26 user defined static assert strings')
|
|
message('Note: SERiF uses some C++26 features specifically 202306L (user defined strings for static asserts), these may not be supported by your compiler and standard library. SERiF will fallback to simpler compile time error messages, but this may make debugging more difficult.')
|
|
endif
|
|
cmake_program = find_program('cmake', required: true)
|
|
# With meson-python, the generated native file pins this to the interpreter
|
|
# building the wheel. For command-line builds, PATH controls the selection.
|
|
python_build = python_mod.find_installation(required: true, pure: false)
|
|
|
|
if meson.is_cross_build()
|
|
message('Cross build: ' + build_machine.system() + ' -> ' + host_machine.system())
|
|
endif
|