diff --git a/.gitignore b/.gitignore index 85ff3c442290befc992ebfb9b5ff865f98ed4056..db1bd34dba500694f0839ab25758ec769f24529b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ /build-*/ /.cache/ + +subprojects/packagecache/ +subprojects/googletest* diff --git a/subprojects/gtest.wrap b/subprojects/gtest.wrap new file mode 100644 index 0000000000000000000000000000000000000000..ca5d699ec0a54c3a1ffa72a733d1e78507f12dd9 --- /dev/null +++ b/subprojects/gtest.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = googletest-release-1.10.0 + +source_url = https://github.com/google/googletest/archive/release-1.10.0.zip +source_filename = gtest-1.10.0.zip +source_hash = 94c634d499558a76fa649edb13721dce6e98fb1e7018dfaeba3cd7a083945e91 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.10.0/1/get_zip +patch_filename = gtest-1.10.0-1-wrap.zip +patch_hash = 04ff14e8880e4e465f6260221e9dfd56fea6bc7cce4c4aff0dc528e4a2c8f514 diff --git a/tests/meson.build b/tests/meson.build index a08c6b54b4fe262af560d8f8973bd70b7e015a49..fea6addad6cbba9a2bcc10b53e0269e82a5be0aa 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -170,7 +170,13 @@ parallel_ok = (not io_uring_enabled) # Meson integration for GTest and GMock # See https://mesonbuild.com/Dependencies.html#gtest-and-gmock -gtest_dep = dependency('gtest', main: true) +gtest_dep = dependency('gtest', main: true, required: false) +# If gtest is not available on the system use the meson wrap provided +# by WrapDB and build it ourself +if not gtest_dep.found() + gtest_sp = subproject('gtest') + gtest_dep = gtest_sp.get_variable('gtest_main_dep') +endif foreach source, test_dict : tests # TODO: Use meson fs (filesystem) module once meson >= 0.53 is in