From 37387bc8fb286701ab85463d7cc5e166302f17f1 Mon Sep 17 00:00:00 2001 From: crouzet Date: Tue, 5 Jun 2018 10:42:11 +0200 Subject: [PATCH] sat #8908 : implement verbose option for sat compile --- src/compilation.py | 9 ++++++++- src/product.py | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/compilation.py b/src/compilation.py index d46a217..e958f9c 100644 --- a/src/compilation.py +++ b/src/compilation.py @@ -51,6 +51,9 @@ class Builder: self.debug_mode = False if "debug" in self.product_info and self.product_info.debug == "yes": self.debug_mode = True + self.verbose_mode = False + if "verbose" in self.product_info and self.product_info.verbose == "yes": + self.verbose_mode = True ## # Shortcut method to log in log file. @@ -118,7 +121,11 @@ class Builder: cmake_option += " -DCMAKE_BUILD_TYPE=Debug" else : cmake_option += " -DCMAKE_BUILD_TYPE=Release" - + + # add verbose option if specified in application for this product. + if self.verbose_mode: + cmake_option += " -DCMAKE_VERBOSE_MAKEFILE=ON" + # In case CMAKE_GENERATOR is defined in environment, # use it in spite of automatically detect it if 'cmake_generator' in self.config.APPLICATION: diff --git a/src/product.py b/src/product.py index 42c59a3..23774e5 100644 --- a/src/product.py +++ b/src/product.py @@ -54,6 +54,7 @@ def get_product_config(config, product_name, with_install_dir=True): # current product debug = 'no' dev = 'no' + verbose = 'no' base = 'maybe' section = None if isinstance(version, src.pyconf.Mapping): @@ -68,6 +69,10 @@ def get_product_config(config, product_name, with_install_dir=True): if 'debug' in dic_version: debug = dic_version.debug + # Get the verbose if any + if 'verbose' in dic_version: + verbose = dic_version.verbose + # Get the dev if any if 'dev' in dic_version: dev = dic_version.dev @@ -164,6 +169,7 @@ Please add a section in it.""") % {"1" : vv, "2" : prod_pyconf_path} # Set the debug, dev and version keys prod_info.debug = debug + prod_info.verbose = verbose prod_info.dev = dev prod_info.version = version @@ -633,6 +639,17 @@ def product_is_debug(product_info): debug = product_info.debug return debug.lower() == 'yes' +def product_is_verbose(product_info): + """Know if a product is in verbose mode + + :param product_info Config: The configuration specific to + the product + :return: True if the product is in verbose mode, else False + :rtype: boolean + """ + verbose = product_info.verbose + return verbose.lower() == 'yes' + def product_is_autotools(product_info): """Know if a product is compiled using the autotools -- 2.39.2