From 9b3803f71c417cfc4272cb93b1e75139bb62e55d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 6 Jan 2017 10:44:49 +0100 Subject: [PATCH] px_process_params.py: fix for empty cmake scope Hotfix for cmake configs which use include() for the module list (eg. posix_sitl_ekf2.cmake or snapdragon). In that case the cmake parser did not find any modules and thus the param list was empty. The proper fix will be to parse the include() statements correctly. --- Tools/px_process_params.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Tools/px_process_params.py b/Tools/px_process_params.py index cba71e5669..e9061823bb 100644 --- a/Tools/px_process_params.py +++ b/Tools/px_process_params.py @@ -142,16 +142,19 @@ def main(): except: use_scope = False pass - if use_scope: + if use_scope and len(cmake_scope.scope) > 0: if not scanner.ScanDir([os.path.join(args.src_path, p) for p in cmake_scope.scope], parser): sys.exit(1) - else: + else: if not scanner.ScanDir([args.src_path], parser): sys.exit(1) if not parser.Validate(): sys.exit(1) param_groups = parser.GetParamGroups() + if len(param_groups) == 0: + print("Warning: no parameters found") + # Output to XML file if args.xml: if args.verbose: print("Creating XML file " + args.xml)