From 997d9f58de73c96dc498491559bb0286ba716759 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 27 Mar 2018 21:04:48 -0700 Subject: [PATCH] build: invert default for header checks In the end the build time is always almost the same, but it's a pain to change one header and have it check the world. CI continues to use the check so we can get any mistake before merging. --- Tools/ardupilotwaf/ap_library.py | 2 +- Tools/scripts/build_ci.sh | 6 +++++- wscript | 12 ++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Tools/ardupilotwaf/ap_library.py b/Tools/ardupilotwaf/ap_library.py index f943ccb757..fe9c39c545 100644 --- a/Tools/ardupilotwaf/ap_library.py +++ b/Tools/ardupilotwaf/ap_library.py @@ -199,7 +199,7 @@ def ap_library_register_for_check(self): if not hasattr(self, 'compiled_tasks'): return - if self.env.DISABLE_HEADER_CHECKS: + if not self.env.ENABLE_HEADER_CHECKS: return for t in self.compiled_tasks: diff --git a/Tools/scripts/build_ci.sh b/Tools/scripts/build_ci.sh index 649ce44dcf..ecc43780ce 100755 --- a/Tools/scripts/build_ci.sh +++ b/Tools/scripts/build_ci.sh @@ -113,7 +113,11 @@ for t in $CI_BUILD_TARGET; do if [[ -n ${waf_supported_boards[$t]} && -z ${CI_CRON_JOB+1} ]]; then echo "Starting waf build for board ${t}..." - $waf configure --board $t --enable-benchmarks --check-c-compiler="$c_compiler" --check-cxx-compiler="$cxx_compiler" + $waf configure --board $t \ + --enable-benchmarks \ + --enable-header-checks \ + --check-c-compiler="$c_compiler" \ + --check-cxx-compiler="$cxx_compiler" $waf clean $waf all ccache -s && ccache -z diff --git a/wscript b/wscript index 754075ad12..3ad95f5d4d 100644 --- a/wscript +++ b/wscript @@ -81,9 +81,9 @@ option disables that. submodules at specific revisions. ''') - g.add_option('--disable-header-checks', action='store_true', + g.add_option('--enable-header-checks', action='store_true', default=False, - help="Disable checking of headers") + help="Enable checking of headers") g.add_option('--default-parameters', default=None, @@ -218,11 +218,11 @@ def configure(cfg): cfg.msg('Setting rsync destination to', cfg.options.rsync_dest) cfg.env.RSYNC_DEST = cfg.options.rsync_dest - if cfg.options.disable_header_checks: - cfg.msg('Disabling header checks', cfg.options.disable_header_checks) - cfg.env.DISABLE_HEADER_CHECKS = True + if cfg.options.enable_header_checks: + cfg.msg('Enabling header checks', cfg.options.enable_header_checks) + cfg.env.ENABLE_HEADER_CHECKS = True else: - cfg.env.DISABLE_HEADER_CHECKS = False + cfg.env.ENABLE_HEADER_CHECKS = False # TODO: Investigate if code could be changed to not depend on the # source absolute path.