1
0
mirror of synced 2025-04-20 11:47:43 +03:00

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
<https://github.com/google/googletest/releases/tag/v1.13.0>.
This commit is contained in:
Andrea Pappacoda 2023-07-12 00:32:41 +02:00 committed by GitHub
parent be07d2d7a9
commit 52d8dd41f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,12 @@ subdir(join_paths('www', 'dir'))
subdir(join_paths('www2', 'dir')) subdir(join_paths('www2', 'dir'))
subdir(join_paths('www3', '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( test(
'main', 'main',
executable( executable(
@ -94,7 +100,8 @@ test(
dependencies: [ dependencies: [
cpp_httplib_dep, cpp_httplib_dep,
gtest_dep gtest_dep
] ],
override_options: test_options
), ),
depends: [ depends: [
key_pem, key_pem,