waf: link tests with gtest library from submodule

That makes it possible to build tests on distributions that don't provide
official packages for gtest. For example, the travis environment is Ubuntu,
which doesn't have official package for gtest library.
This commit is contained in:
Gustavo Jose de Sousa 2016-01-18 14:41:21 -02:00 committed by Lucas De Marchi
parent 8d0522f6ef
commit e9195a3989
1 changed files with 7 additions and 6 deletions

13
wscript
View File

@ -80,6 +80,7 @@ def configure(cfg):
cfg.load('waf_unit_test')
cfg.load('mavgen')
cfg.load('gbenchmark')
cfg.load('gtest')
cfg.load('static_linking')
cfg.start_msg('Benchmarks')
@ -88,12 +89,11 @@ def configure(cfg):
else:
cfg.end_msg('disabled', color='YELLOW')
cfg.env.HAS_GTEST = cfg.check_cxx(
lib='gtest',
mandatory=False,
uselib_store='GTEST',
errmsg='not found, unit tests disabled',
)
cfg.start_msg('Unit tests')
if cfg.env.HAS_GTEST:
cfg.end_msg('enabled')
else:
cfg.end_msg('disabled', color='YELLOW')
cfg.env.prepend_value('INCLUDES', [
cfg.srcnode.abspath() + '/libraries/',
@ -117,6 +117,7 @@ def list_boards(ctx):
print(*boards.get_boards_names())
def build(bld):
bld.load('gtest')
#generate mavlink headers
bld(