Skip to content

Commit

Permalink
Make the gtest dependency optional.
Browse files Browse the repository at this point in the history
This is needed to build in flatpak.
  • Loading branch information
mgautierfr committed Aug 12, 2019
1 parent 1e0c9a1 commit 3e3e168
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
*.swp
1 change: 1 addition & 0 deletions subprojects/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gtest
23 changes: 14 additions & 9 deletions test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ tests = [
]


gtest_dep = dependency('gtest', main:true, fallback: ['gtest', 'gtest_dep'])
gtest_dep = dependency('gtest',
main:true,
fallback: ['gtest', 'gtest_dep'],
required:false)

foreach test_name : tests
test_exe = executable(test_name, [test_name+'.cpp'],
link_with : kiwixlib,
link_args: extra_link_args,
dependencies : all_deps + [gtest_dep],
build_rpath : '$ORIGIN')
test(test_name, test_exe)
endforeach
if gtest_dep.found()
foreach test_name : tests
test_exe = executable(test_name, [test_name+'.cpp'],
link_with : kiwixlib,
link_args: extra_link_args,
dependencies : all_deps + [gtest_dep],
build_rpath : '$ORIGIN')
test(test_name, test_exe)
endforeach
endif

0 comments on commit 3e3e168

Please sign in to comment.