mirror of https://github.com/kiwix/libkiwix.git
Make the gtest dependency optional. (#253)
Make the gtest dependency optional.
This commit is contained in:
commit
a8668db2fe
|
@ -1 +1,2 @@
|
|||
.idea/
|
||||
*.swp
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
gtest
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue