(compileOutput: string)
| 137 | } |
| 138 | |
| 139 | function extractCompilerInfo(compileOutput: string) { |
| 140 | const rxCompArg = /-(I|D)("[^"]+"|[\S]+)/gm; |
| 141 | |
| 142 | const compDefines: string[] = []; |
| 143 | const compIncludes: string[] = []; |
| 144 | const compLookup = { 'D': compDefines, 'I': compIncludes }; |
| 145 | |
| 146 | let m: RegExpExecArray | null; |
| 147 | while ((m = rxCompArg.exec(compileOutput)) !== null) { |
| 148 | if (m.index === rxCompArg.lastIndex) { |
| 149 | rxCompArg.lastIndex++; |
| 150 | } |
| 151 | |
| 152 | // The regex guarantees that the first group is 'I' or 'D' |
| 153 | compLookup[(m[1] as 'D' | 'I')].push(ensureUnquoted(m[2])); |
| 154 | } |
| 155 | |
| 156 | return { |
| 157 | compDefines: compDefines, |
| 158 | compIncludes: compIncludes |
| 159 | }; |
| 160 | } |
| 161 | |
| 162 | function extractCompilerStd(compileOutput: string): string | undefined { |
| 163 | const rxStd = /-std=(\S+)/; |
no test coverage detected