fbt: compile_db fixes (#1981)

* fbt: forked compilation_db tool
* fbt: fixes for static analysis
* pvs-studio: ignoring more generic warnings
* fbt: util: added extract_abs_dir
* vscode: added fap-set-debug-elf-root for debug configurations
This commit is contained in:
hedger
2022-11-07 18:54:41 +04:00
committed by GitHub
parent aa2ecbe80f
commit 2d6c2886ae
9 changed files with 307 additions and 8 deletions

View File

@@ -43,12 +43,18 @@ def single_quote(arg_list):
return " ".join(f"'{arg}'" if " " in arg else str(arg) for arg in arg_list)
def extract_abs_dir_path(node):
def extract_abs_dir(node):
if isinstance(node, SCons.Node.FS.EntryProxy):
node = node.get()
for repo_dir in node.get_all_rdirs():
if os.path.exists(repo_dir.abspath):
return repo_dir.abspath
return repo_dir
raise StopError(f"Can't find absolute path for {node.name}")
def extract_abs_dir_path(node):
abs_dir_node = extract_abs_dir(node)
if abs_dir_node is None:
raise StopError(f"Can't find absolute path for {node.name}")
return abs_dir_node.abspath