@@ -156,6 +156,10 @@ export class CppProperties {
156156 this . handleConfigurationChange ( ) ;
157157 }
158158
159+ public get VcpkgInstalled ( ) : boolean {
160+ return this . vcpkgIncludes . length > 0 ;
161+ }
162+
159163 private onConfigurationsChanged ( ) : void {
160164 this . configurationsChanged . fire ( this . Configurations ) ;
161165 }
@@ -234,28 +238,29 @@ export class CppProperties {
234238 // Check for vcpkg instance and include relevent paths if found.
235239 if ( await util . checkFileExists ( util . getVcpkgPathDescriptorFile ( ) ) ) {
236240 let vcpkgRoot : string = await util . readFileText ( util . getVcpkgPathDescriptorFile ( ) ) ;
237- let vcpkgInstallPath : string = path . join ( vcpkgRoot . trim ( ) , "/installed" ) ;
238- if ( await util . checkDirectoryExists ( vcpkgInstallPath ) ) {
239- let list : string [ ] = await util . readDir ( vcpkgInstallPath ) ;
240- // For every *directory* in the list (non-recursive)
241- list . forEach ( ( entry ) => {
242- if ( entry !== "vcpkg" ) {
243- let pathToCheck : string = path . join ( vcpkgInstallPath , entry ) ;
244- if ( fs . existsSync ( pathToCheck ) ) {
245- let p : string = path . join ( pathToCheck , "include" ) ;
246- if ( fs . existsSync ( p ) ) {
247- this . vcpkgIncludes . push ( p ) ;
241+ if ( await util . checkDirectoryExists ( vcpkgRoot ) ) {
242+ let vcpkgInstalledPath : string = path . join ( vcpkgRoot . trim ( ) , "/installed" ) ;
243+ let list : string [ ] = await util . readDir ( vcpkgInstalledPath ) ;
244+ if ( list !== undefined ) {
245+ // For every *directory* in the list (non-recursive). Each directory is basically a platform.
246+ list . forEach ( ( entry ) => {
247+ if ( entry !== "vcpkg" ) {
248+ let pathToCheck : string = path . join ( vcpkgInstalledPath , entry ) ;
249+ if ( fs . existsSync ( pathToCheck ) ) {
250+ let p : string = path . join ( pathToCheck , "include" ) ;
251+ if ( fs . existsSync ( p ) ) {
252+ this . vcpkgIncludes . push ( p ) ;
253+ }
248254 }
249255 }
250- }
251- } ) ;
256+ } ) ;
257+ }
252258 }
253259 }
254260 } catch ( error ) { } finally {
255261 this . vcpkgPathReady = true ;
256262 this . handleConfigurationChange ( ) ;
257263 }
258-
259264 }
260265
261266 private getConfigIndexForPlatform ( config : any ) : number {
0 commit comments