From e9195a3989dd1b64fa016c39dc4fdfdab6fcd00e Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Mon, 18 Jan 2016 14:41:21 -0200 Subject: [PATCH] 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. --- wscript | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wscript b/wscript index 044e4e9923..28e331e022 100644 --- a/wscript +++ b/wscript @@ -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(