Skip to content

Commit

Permalink
use system gtest if available
Browse files Browse the repository at this point in the history
Package maintainers won't need to patch Aegisub to use the system
version. This also helps Aegisub compile on platforms where the
unmodified gtest source doesn't compile but a package is available, such
as OpenBSD.

I've tested the conditional branch where gtest is present in the system
on OpenBSD. I can't properly test the branch where it isn't present
because the subproject doesn't compile on OpenBSD, but I've checked that
it tries to compile the subproject.
  • Loading branch information
guijan committed Dec 19, 2024
1 parent 5fa6e4e commit f2e56b6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
gtest_proj = subproject('gtest')
gtest_dep = gtest_proj.get_variable('gtest_dep')
gmock_dep = gtest_proj.get_variable('gmock_dep')
gtest_dep = dependency('gtest', required : false)
gmock_dep = dependency('gmock', required : false)

if not (gtest_dep.found() and gmock_dep.found())
gtest_proj = subproject('gtest')
gtest_dep = gtest_proj.get_variable('gtest_dep')
gmock_dep = gtest_proj.get_variable('gmock_dep')
endif

tests_deps = [
gtest_dep,
Expand Down

0 comments on commit f2e56b6

Please sign in to comment.