File tree Expand file tree Collapse file tree 1 file changed +10
-19
lines changed Expand file tree Collapse file tree 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):
1515 buildDir = build_dir
1616 )
1717
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.
2020
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
2525 """
2626
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
4031
4132
4233class Target :
You can’t perform that action at this time.
0 commit comments