Make the gtest dependency optional.

This is needed to build in flatpak.
This commit is contained in:
Matthieu Gautier committed 2019-08-12 15:31:16 +02:00
1 parent 1e0c9a120a
commit 3e3e1683f5
3 files changed
+16 -9

No files matched your search

+1
View File
@@ -1 +1,2 @@
.idea/
*.swp
+1
View File
@@ -0,0 +1 @@
gtest
+14 -9
View File
@@ -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