From 52d8dd41f1dc239d8eceed1253631022653783cc Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Wed, 12 Jul 2023 00:32:41 +0200 Subject: [PATCH] build(meson): use C++14 with GTest >= 1.13.0 (#1618) GoogleTest, starting with vesion 1.13.0, requires C++14 to build. This patch enables C++14 if GoogleTest 1.13.0 or newer is detected when compiling the tests with Meson, making it possible to use new GTest versions. You can find GoogleTest's release notes at . --- test/meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/meson.build b/test/meson.build index 293ba05..a83360d 100644 --- a/test/meson.build +++ b/test/meson.build @@ -86,6 +86,12 @@ subdir(join_paths('www', 'dir')) subdir(join_paths('www2', 'dir')) subdir(join_paths('www3', 'dir')) +# GoogleTest 1.13.0 requires C++14 +test_options = [] +if gtest_dep.version().version_compare('>=1.13.0') + test_options += 'cpp_std=c++14' +endif + test( 'main', executable( @@ -94,7 +100,8 @@ test( dependencies: [ cpp_httplib_dep, gtest_dep - ] + ], + override_options: test_options ), depends: [ key_pem,