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.
This commit is contained in:
Beat Küng
2017-01-06 10:44:49 +01:00
parent ff560e8c16
commit 9b3803f71c
+5 -2
View File
@@ -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)