@@ -847,9 +847,9 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp
847847let additionalArgs :string [ ] = [ ] ;
848848let isWindows :boolean = os . platform ( ) === 'win32' ;
849849if ( compilerPath ) {
850- if ( compilerPath === "cl.exe" ) {
850+ if ( compilerPath . endsWith ( "\\cl.exe" ) || compilerPath . endsWith ( "/cl.exe" ) || compilerPath === "cl.exe" ) {
851851// Input is only compiler name, this is only for cl.exe
852- compilerName = compilerPath ;
852+ compilerName = path . basename ( compilerPath ) ;
853853
854854} else if ( compilerPath . startsWith ( "\"" ) ) {
855855// Input has quotes around compiler path
@@ -881,6 +881,7 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp
881881additionalArgs = additionalArgs . filter ( ( arg :string ) => arg . trim ( ) . length !== 0 ) ; // Remove empty args.
882882compilerPath = potentialCompilerPath ;
883883}
884+ compilerName = path . basename ( compilerPath ) ;
884885}
885886// Get compiler name if there are no args but path is valid or a valid path was found with args.
886887if ( compilerPath === "cl.exe" || checkFileExistsSync ( compilerPath ) ) {