Conditions | 9 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | ''' |
||
14 | def compiler_cmdline(compiler=GCC, output=None, inputs=None): |
||
15 | cmdline = [] |
||
16 | for element in compiler: |
||
17 | if element == '{output}': |
||
18 | if output: |
||
19 | cmdline.append(output) |
||
20 | else: |
||
21 | logger.error('Compiler output name is needed, but not given.') |
||
22 | raise ValidatorBrokenException("You need to declare the output name for this compiler.") |
||
23 | elif element == '{inputs}': |
||
24 | if inputs: |
||
25 | for fname in inputs: |
||
26 | if compiler in [GCC, GPP] and fname.endswith('.h'): |
||
27 | logger.debug('Omitting {0} in the compiler call.'.format(fname)) |
||
28 | else: |
||
29 | cmdline.append(fname) |
||
30 | else: |
||
31 | logger.error('Input file names for compiler are not given.') |
||
32 | raise ValidatorBrokenException('You need to declare input files for this compiler.') |
||
33 | else: |
||
34 | cmdline.append(element) |
||
35 | return cmdline[0], cmdline[1:] |
||
36 |