File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -163,12 +163,28 @@ impl DevelPack {
163
163
/// Downloads a new PHP development pack, unzips it in the build script
164
164
/// temporary directory.
165
165
fn new ( version : & str , is_zts : bool , arch : Arch ) -> Result < DevelPack > {
166
+ // If the PHP version is more than 8.4.1, use VS17 instead of VS16.
167
+ let version_float = version
168
+ . split ( '.' )
169
+ . take ( 2 )
170
+ . collect :: < Vec < _ > > ( )
171
+ . join ( "." )
172
+ . parse :: < f32 > ( )
173
+ . context ( "Failed to parse PHP version as float" ) ?;
174
+
175
+ // PHP builds switched to VS17 in PHP 8.4.1.
176
+ let visual_studio_version = if version_float >= 8.4f32 {
177
+ "vs17"
178
+ } else {
179
+ "vs16"
180
+ } ;
181
+
182
+
166
183
let zip_name = format ! (
167
184
"php-devel-pack-{}{}-Win32-{}-{}.zip" ,
168
185
version,
169
186
if is_zts { "" } else { "-nts" } ,
170
- "vs16" , /* TODO(david): At the moment all PHPs supported by ext-php-rs use VS16 so
171
- * this is constant. */
187
+ visual_studio_version,
172
188
arch
173
189
) ;
174
190
You can’t perform that action at this time.
0 commit comments