From 3608c3eb029daf888000350872d81128c2f296ff Mon Sep 17 00:00:00 2001 From: rowanG077 Date: Mon, 6 Feb 2023 16:08:35 +0100 Subject: common: Implement Werror flag --- common/kernel/command.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common/kernel/command.cc') diff --git a/common/kernel/command.cc b/common/kernel/command.cc index 842d8a71..2fb4ee53 100644 --- a/common/kernel/command.cc +++ b/common/kernel/command.cc @@ -105,6 +105,10 @@ bool CommandHandler::executeBeforeContext() log_streams.push_back(std::make_pair(&std::cerr, LogLevel::LOG_MSG)); } + if (vm.count("Werror")) { + log_warn_as_error = true; + } + if (vm.count("log")) { std::string logfilename = vm["log"].as(); logfile.open(logfilename); @@ -121,6 +125,7 @@ po::options_description CommandHandler::getGeneralOptions() general.add_options()("help,h", "show help"); general.add_options()("verbose,v", "verbose output"); general.add_options()("quiet,q", "quiet mode, only errors and warnings displayed"); + general.add_options()("Werror", "Turn warnings into errors"); general.add_options()("log,l", po::value(), "log file, all log messages are written to this file regardless of -q"); general.add_options()("debug", "debug output"); -- cgit v1.2.3