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:
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
.idea/
|
.idea/
|
||||||
|
*.swp
|
||||||
|
1
subprojects/.gitignore
vendored
Normal file
1
subprojects/.gitignore
vendored
Normal file
@ -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
|
if gtest_dep.found()
|
||||||
test_exe = executable(test_name, [test_name+'.cpp'],
|
foreach test_name : tests
|
||||||
link_with : kiwixlib,
|
test_exe = executable(test_name, [test_name+'.cpp'],
|
||||||
link_args: extra_link_args,
|
link_with : kiwixlib,
|
||||||
dependencies : all_deps + [gtest_dep],
|
link_args: extra_link_args,
|
||||||
build_rpath : '$ORIGIN')
|
dependencies : all_deps + [gtest_dep],
|
||||||
test(test_name, test_exe)
|
build_rpath : '$ORIGIN')
|
||||||
endforeach
|
test(test_name, test_exe)
|
||||||
|
endforeach
|
||||||
|
endif
|
||||||
|
Reference in New Issue
Block a user