@@ -267,17 +267,13 @@ export class CppProperties {
267
267
}
268
268
269
269
private getConfigIndexForPlatform ( config : any ) : number {
270
- if ( this . configurationJson . configurations . length > 3 ) {
271
- return this . configurationJson . configurations . length - 1 ; // Default to the last custom configuration.
272
- }
273
- let nodePlatform : NodeJS . Platform = process . platform ;
274
270
let plat : string ;
275
- if ( nodePlatform === 'linux' ) {
276
- plat = "Linux" ;
277
- } else if ( nodePlatform === 'darwin' ) {
271
+ if ( process . platform === 'darwin' ) {
278
272
plat = "Mac" ;
279
- } else if ( nodePlatform === 'win32' ) {
273
+ } else if ( process . platform === 'win32' ) {
280
274
plat = "Win32" ;
275
+ } else {
276
+ plat = "Linux" ;
281
277
}
282
278
for ( let i : number = 0 ; i < this . configurationJson . configurations . length ; i ++ ) {
283
279
if ( config . configurations [ i ] . name === plat ) {
@@ -293,14 +289,12 @@ export class CppProperties {
293
289
return "clang-x64" ;
294
290
} else if ( name === "Win32" ) {
295
291
return "msvc-x64" ;
296
- } else {
292
+ } else if ( process . platform === 'win32' ) {
297
293
// Custom configs default to the OS's preference.
298
- let nodePlatform : NodeJS . Platform = process . platform ;
299
- if ( nodePlatform === 'linux' || nodePlatform === 'darwin' ) {
300
- return "clang-x64" ;
301
- }
294
+ return "msvc-x64" ;
295
+ } else {
296
+ return "clang-x64" ;
302
297
}
303
- return "msvc-x64" ;
304
298
}
305
299
306
300
private includePathConverted ( ) : boolean {
@@ -595,7 +589,7 @@ export class CppProperties {
595
589
for ( let i : number = 0 ; i < this . configurationJson . configurations . length ; i ++ ) {
596
590
let config : Configuration = this . configurationJson . configurations [ i ] ;
597
591
// Look for Mac configs and extra configs on Mac systems
598
- if ( config . name === "Mac" || ( process . platform === " darwin" && config . name !== "Win32" && config . name !== "Linux" ) ) {
592
+ if ( config . name === "Mac" || ( process . platform === ' darwin' && config . name !== "Win32" && config . name !== "Linux" ) ) {
599
593
if ( config . macFrameworkPath === undefined ) {
600
594
config . macFrameworkPath = [
601
595
"/System/Library/Frameworks" ,
0 commit comments