1
- bool SKIP_ANGLE = Argument ( "skipAngle" , false ) ;
1
+ bool SKIP_ANGLE = Argument ( "skipAngle" , false ) ;
2
2
string VC_TOOLSET_VERSION = Argument ( "vcToolsetVersion" , "14.2" ) ;
3
3
4
4
DirectoryPath ROOT_PATH = MakeAbsolute ( Directory ( "../.." ) ) ;
5
- DirectoryPath VCPKG_PATH = MakeAbsolute ( ROOT_PATH . Combine ( "externals/vcpkg" ) ) ;
5
+ DirectoryPath VCPKG_PATH = EnvironmentVariable ( "VCPKG_ROOT" ) ?? MakeAbsolute ( ROOT_PATH . Combine ( "externals/vcpkg" ) ) ;
6
6
DirectoryPath OUTPUT_PATH = MakeAbsolute ( ROOT_PATH . Combine ( "output/native/uwp" ) ) ;
7
7
8
8
#load "../../cake/native-shared.cake"
@@ -102,12 +102,12 @@ Task("ANGLE")
102
102
if ( SKIP_ANGLE )
103
103
return ;
104
104
105
- if ( ! DirectoryExists ( VCPKG_PATH ) )
106
- RunProcess ( "git" , $ "clone --depth 1 https://github.com/microsoft/vcpkg.git --branch master --single-branch { VCPKG_PATH } ") ;
105
+ if ( ! DirectoryExists ( VCPKG_PATH ) )
106
+ RunProcess ( "git" , $ "clone --depth 1 https://github.com/microsoft/vcpkg.git --branch master --single-branch { VCPKG_PATH } ") ;
107
107
108
- var vcpkg = VCPKG_PATH . CombineWithFilePath ( "vcpkg.exe" ) ;
109
- if ( ! FileExists ( vcpkg ) )
110
- RunProcess ( VCPKG_PATH . CombineWithFilePath ( "bootstrap-vcpkg.bat" ) ) ;
108
+ var vcpkg = VCPKG_PATH . CombineWithFilePath ( "vcpkg.exe" ) ;
109
+ if ( ! FileExists ( vcpkg ) )
110
+ RunProcess ( VCPKG_PATH . CombineWithFilePath ( "bootstrap-vcpkg.bat" ) ) ;
111
111
112
112
var platform_toolset = string . IsNullOrEmpty ( VC_TOOLSET_VERSION ) ? "" : $ "v{ VC_TOOLSET_VERSION . Replace ( "." , "" ) } ";
113
113
var toolset_suffix = string . IsNullOrEmpty ( VC_TOOLSET_VERSION ) ? "" : $ "-{ platform_toolset } ";
@@ -122,16 +122,18 @@ Task("ANGLE")
122
122
if ( Skip ( arch ) ) return ;
123
123
124
124
var triplet = $ "{ arch } -uwp{ toolset_suffix } ";
125
+ var tripletsRoot = MakeAbsolute ( ( DirectoryPath ) "ANGLE/triplets" ) ;
125
126
126
127
// make the versioned triplets
127
128
if ( ! string . IsNullOrEmpty ( VC_TOOLSET_VERSION ) ) {
128
- var cmake = VCPKG_PATH . CombineWithFilePath ( $ "triplets/community/{ triplet } .cmake") ;
129
- if ( ! FileExists ( cmake ) ) {
130
- var src = VCPKG_PATH . CombineWithFilePath ( $ "triplets/{ arch } -uwp.cmake") ;
131
- if ( ! FileExists ( src ) )
132
- src = VCPKG_PATH . CombineWithFilePath ( $ "triplets/community/{ arch } -uwp.cmake") ;
133
- CopyFile ( src , cmake ) ;
134
- System . IO . File . AppendAllLines ( cmake . FullPath , new [ ] {
129
+ var cmake = tripletsRoot . CombineWithFilePath ( $ "{ triplet } .cmake") ;
130
+ if ( ! FileExists ( cmake ) ) {
131
+ EnsureDirectoryExists ( tripletsRoot ) ;
132
+ var src = VCPKG_PATH . CombineWithFilePath ( $ "triplets/{ arch } -uwp.cmake") ;
133
+ if ( ! FileExists ( src ) )
134
+ src = VCPKG_PATH . CombineWithFilePath ( $ "triplets/community/{ arch } -uwp.cmake") ;
135
+ CopyFile ( src , cmake ) ;
136
+ System . IO . File . AppendAllLines ( cmake . FullPath , new [ ] {
135
137
$ "set(VCPKG_PLATFORM_TOOLSET \" { platform_toolset } \" )",
136
138
$ "set(VCPKG_DEP_INFO_OVERRIDE_VARS \" { platform_toolset } \" )",
137
139
} ) ;
@@ -141,16 +143,16 @@ Task("ANGLE")
141
143
var d = CONFIGURATION . ToLower ( ) == "release" ? "" : "debug/" ;
142
144
var zd = CONFIGURATION . ToLower ( ) == "release" ? "" : "d" ;
143
145
144
- RunProcess ( vcpkg , $ "install angle:{ triplet } ") ;
146
+ RunProcess ( vcpkg , $ "install angle:{ triplet } --overlay-triplets= \" { tripletsRoot } \" ") ;
145
147
146
148
var outDir = OUTPUT_PATH . Combine ( arch ) ;
147
149
EnsureDirectoryExists ( outDir ) ;
148
- CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/libEGL.dll") , outDir ) ;
149
- CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/libEGL.pdb") , outDir ) ;
150
- CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/libGLESv2.dll") , outDir ) ;
151
- CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/libGLESv2.pdb") , outDir ) ;
152
- CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/zlib{ zd } 1.dll") , outDir ) ;
153
- CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/zlib{ zd } .pdb") , outDir ) ;
150
+ CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/libEGL.dll") , outDir ) ;
151
+ CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/libEGL.pdb") , outDir ) ;
152
+ CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/libGLESv2.dll") , outDir ) ;
153
+ CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/libGLESv2.pdb") , outDir ) ;
154
+ CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/zlib{ zd } 1.dll") , outDir ) ;
155
+ CopyFileToDirectory ( VCPKG_PATH . CombineWithFilePath ( $ "installed/{ triplet } /{ d } bin/zlib{ zd } .pdb") , outDir ) ;
154
156
}
155
157
} ) ;
156
158
0 commit comments