mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Make the gtest dependency optional.
This is needed to build in flatpak.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user