File tree 1 file changed +10
-19
lines changed
1 file changed +10
-19
lines changed Original file line number Diff line number Diff line change @@ -15,28 +15,19 @@ def __init__(self, build_dir):
15
15
buildDir = build_dir
16
16
)
17
17
18
- def get_compilation_arguments (self , filename = None ):
19
- """Returns the compilation commands extracted from the compilation database
18
+ def get_compilation_arguments (self , filename ):
19
+ """Returns the compilation commands extracted from the compilation database.
20
20
21
- :param filename: Get compilation arguments of the file, defaults to None: get for all files
22
- :type filename: str, optional
23
- :return: ilenames and their compiler arguments: {filename: compiler arguments}
24
- :rtype: dict
21
+ :param filename: Get compilation arguments of the file.
22
+ :type filename: str
23
+ :return: Compiler arguments.
24
+ :rtype: list
25
25
"""
26
26
27
- if filename :
28
- # Get compilation commands from the compilation database for the given file
29
- compilation_commands = self .compilation_database .getCompileCommands (
30
- filename = filename
31
- )
32
- else :
33
- # Get all compilation commands from the compilation database
34
- compilation_commands = self .compilation_database .getAllCompileCommands ()
35
-
36
- return {
37
- command .filename : list (command .arguments )[1 :- 1 ]
38
- for command in compilation_commands
39
- }
27
+ compilation_arguments = []
28
+ for command in self .compilation_database .getCompileCommands (filename = filename ):
29
+ compilation_arguments += list (command .arguments )[1 :- 1 ]
30
+ return compilation_arguments
40
31
41
32
42
33
class Target :
You can’t perform that action at this time.
0 commit comments