Skip to content

Commit fc69d50

Browse files
author
Elaheh Rashedi
authored
use /Fe<file> for older cl.exe version (#9252)
1 parent 7f21a55 commit fc69d50

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Extension/src/LanguageServer/cppBuildTaskProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class CppBuildTaskProvider implements TaskProvider {
169169
const taskLabel: string = ((appendSourceToName && !compilerPathBase.startsWith(ext.configPrefix)) ?
170170
ext.configPrefix : "") + compilerPathBase + " " + localize("build_active_file", "build active file");
171171
const programName: string = util.defaultExePath();
172-
let args: string[] = isCl ? ['/Zi', '/EHsc', '/nologo', '/Fe:', programName, '${file}'] : ['-fdiagnostics-color=always', '-g', '${file}', '-o', programName];
172+
let args: string[] = isCl ? ['/Zi', '/EHsc', '/nologo', `/Fe${programName}`, '${file}'] : ['-fdiagnostics-color=always', '-g', '${file}', '-o', programName];
173173
if (compilerArgs && compilerArgs.length > 0) {
174174
args = args.concat(compilerArgs);
175175
}

Extension/src/common.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,11 @@ export function defaultExePath(): string {
328328
}
329329

330330
export function findExePathInArgs(args: string[]): string | undefined {
331-
return args.find((arg: string, index: number) => (arg.includes(".exe") || (index > 0 && args[index - 1] === "-o")));
331+
const exePath: string | undefined = args.find((arg: string, index: number) => (arg.includes(".exe") || (index > 0 && args[index - 1] === "-o")));
332+
if (exePath?.startsWith("/Fe")) {
333+
return exePath.substring(3);
334+
}
335+
return exePath;
332336
}
333337

334338
// Pass in 'arrayResults' if a string[] result is possible and a delimited string result is undesirable.

0 commit comments

Comments
 (0)