2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 09:57:15 +01:00

Use task.get_cwd() in clang_compilation_database

This commit is contained in:
Thomas Nagy 2019-11-10 19:00:50 +01:00
parent 11f449ee57
commit b27afc7bbc
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA

View File

@ -25,7 +25,6 @@ Usage:
conf.load('clang_compilation_database') conf.load('clang_compilation_database')
""" """
import os
from waflib import Logs, TaskGen, Task, Build, Scripting from waflib import Logs, TaskGen, Task, Build, Scripting
Task.Task.keep_last_cmd = True Task.Task.keep_last_cmd = True
@ -63,11 +62,10 @@ class ClangDbContext(Build.BuildContext):
cmd = task.last_cmd cmd = task.last_cmd
except AttributeError: except AttributeError:
continue continue
directory = getattr(task, 'cwd', self.variant_dir)
f_node = task.inputs[0] f_node = task.inputs[0]
filename = f_node.path_from(task.get_cwd()) filename = f_node.path_from(task.get_cwd())
entry = { entry = {
"directory": directory, "directory": task.get_cwd().abspath(),
"arguments": cmd, "arguments": cmd,
"file": filename, "file": filename,
} }