14
14
<label :for =" index" >{{ index }}</label >
15
15
</div >
16
16
</div >
17
- <div class =" my-btn" @click =" selectCommon" >{{ I18N[lang].selectCommon }}</div >
17
+ <div class =" my-btn" v-if = " selectedSystem !== 'windows' " @click =" selectCommon" >{{ I18N[lang].selectCommon }}</div >
18
18
<div class =" my-btn" @click =" checkedExts = []" >{{ I18N[lang].selectNone }}</div >
19
19
20
20
<details class =" details custom-block" >
41
41
<p class =" custom-block-title" >WARNING</p >
42
42
<p >{{ I18N[lang].microUnavailable }}</p >
43
43
</div >
44
+ <div v-if =" selectedSystem === 'windows' && (checkedTargets.indexOf('fpm') !== -1 || checkedTargets.indexOf('embed') !== -1)" class =" warning custom-block" >
45
+ <p class =" custom-block-title" >WARNING</p >
46
+ <p >{{ I18N[lang].windowsSAPIUnavailable }}</p >
47
+ </div >
44
48
<h2 >{{ I18N[lang].buildOptions }}</h2 >
45
49
<div class =" option-line" >
46
50
<span class =" option-title" >{{ I18N[lang].buildEnvironment }}</span >
47
51
<select v-model =" selectedEnv" >
48
52
<option value =" native" >{{ I18N[lang].buildEnvNative }}</option >
49
53
<option value =" spc" >{{ I18N[lang].buildEnvSpc }}</option >
50
- <option value =" docker" >{{ I18N[lang].buildEnvDocker }}</option >
54
+ <option value =" docker" v-if = " selectedSystem !== 'windows' " >{{ I18N[lang].buildEnvDocker }}</option >
51
55
</select >
52
56
</div >
53
57
<div v-if =" selectedEnv === 'spc'" class =" option-line" >
54
58
<span class =" option-title" >{{ I18N[lang].selectedArch }}</span >
55
59
<select v-model =" selectedArch" >
56
60
<option value =" x86_64" >x86_64 (amd64)</option >
57
- <option value =" aarch64" >aarch64 (arm64)</option >
61
+ <option value =" aarch64" v-if = " selectedSystem !== 'windows' " >aarch64 (arm64)</option >
58
62
</select >
59
63
</div >
60
64
<div class =" option-line" >
87
91
<input type =" radio" id =" show-download-no" :value =" 0" v-model =" downloadByExt" />
88
92
<label for =" show-download-no" >{{ I18N[lang].no }}</label >
89
93
</div >
94
+ <div class =" option-line" v-if =" selectedSystem !== 'macos'" >
95
+ <span class =" option-title" >{{ I18N[lang].useUPX }}</span >
96
+ <input type =" radio" id =" upx-yes" :value =" 1" v-model =" enableUPX" />
97
+ <label for =" upx-yes" >{{ I18N[lang].yes }}</label >
98
+
99
+ <input type =" radio" id =" upx-no" :value =" 0" v-model =" enableUPX" />
100
+ <label for =" upx-no" >{{ I18N[lang].no }}</label >
101
+ </div >
90
102
<h2 >{{ I18N[lang].hardcodedINI }}</h2 >
91
103
<textarea class =" textarea" :placeholder =" I18N[lang].hardcodedINIPlacehoder" v-model =" hardcodedINIData" rows =" 5" />
92
104
<h2 >{{ I18N[lang].resultShow }}</h2 >
93
105
<div v-if =" selectedEnv === 'spc'" class =" command-container" >
94
106
<b >{{ I18N[lang].downloadSPCBinaryCommand }}</b >
95
- <div class =" command-preview" >
107
+ <div class =" command-preview" v-if = " selectedSystem !== 'windows' " >
96
108
curl -o spc.tgz https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-{{ selectedSystem }}-{{ selectedArch }}.tar.gz && tar -zxvf spc.tgz && rm spc.tgz<br >
97
109
</div >
110
+ <div v-else >
111
+ <div class =" warning custom-block" >
112
+ <p class =" custom-block-title" >WARNING</p >
113
+ <p >{{ I18N[lang].windowsDownSPCWarning }}</p >
114
+ </div >
115
+ </div >
98
116
</div >
99
117
<div v-if =" downloadByExt" class =" command-container" >
100
118
<b >{{ I18N[lang].downloadExtOnlyCommand }}</b >
106
124
</div >
107
125
<div class =" command-container" >
108
126
<b >{{ I18N[lang].compileCommand }}</b >
109
- <div class =" command-preview" >{{ spcCommand }} build {{ buildCommand }} "{{ extList }}"{{ additionalLibs }}{{ debug ? ' --debug' : '' }}{{ zts ? ' --enable-zts' : '' }}{{ displayINI }}</div >
127
+ <div class =" command-preview" >{{ spcCommand }} build {{ buildCommand }} "{{ extList }}"{{ additionalLibs }}{{ debug ? ' --debug' : '' }}{{ zts ? ' --enable-zts' : '' }}{{ enableUPX ? ' --with-upx-pack' : '' }}{{ displayINI }}</div >
110
128
</div >
111
129
</div >
112
130
</template >
@@ -137,7 +155,7 @@ defineProps({
137
155
const osList = [
138
156
{ os: ' linux' , label: ' Linux' , disabled: false },
139
157
{ os: ' macos' , label: ' macOS' , disabled: false },
140
- { os: ' windows' , label: ' Windows' , disabled: true },
158
+ { os: ' windows' , label: ' Windows' , disabled: false },
141
159
];
142
160
143
161
const availablePhpVersions = [
@@ -177,6 +195,9 @@ const I18N = {
177
195
buildLibs: ' 要构建的库' ,
178
196
depTips: ' 选择扩展后,不可选中的项目为必需的依赖,编译的依赖库列表中可选的为现有扩展和依赖库的可选依赖。选择可选依赖后,将生成 --with-libs 参数。' ,
179
197
microUnavailable: ' micro 不支持 PHP 7.4 及更早版本!' ,
198
+ windowsSAPIUnavailable: ' Windows 目前不支持 fpm、embed 构建!' ,
199
+ useUPX: ' 是否开启 UPX 压缩(减小二进制体积)' ,
200
+ windowsDownSPCWarning: ' Windows 下请手动下载 spc.exe 二进制文件并解压到当前目录!' ,
180
201
},
181
202
en: {
182
203
selectExt: ' Select Extensions' ,
@@ -205,7 +226,10 @@ const I18N = {
205
226
selectedSystem: ' Select Build OS' ,
206
227
buildLibs: ' Select Dependencies' ,
207
228
depTips: ' After selecting the extensions, the unselectable items are essential dependencies. In the compiled dependencies list, optional dependencies consist of existing extensions and optional dependencies of libraries. Optional dependencies will be added in --with-libs parameter.' ,
208
- microUnavailable: ' Micro does not support PHP 7.4 and earlier versions!'
229
+ microUnavailable: ' Micro does not support PHP 7.4 and earlier versions!' ,
230
+ windowsSAPIUnavailable: ' Windows does not support fpm and embed build!' ,
231
+ useUPX: ' Enable UPX compression (reduce binary size)' ,
232
+ windowsDownSPCWarning: ' Please download the spc.exe binary file manually and extract it to the current directory on Windows!' ,
209
233
}
210
234
};
211
235
@@ -275,6 +299,9 @@ const zts = ref(0);
275
299
// chosen download by extensions
276
300
const downloadByExt = ref (1 );
277
301
302
+ // chosen upx
303
+ const enableUPX = ref (0 );
304
+
278
305
const hardcodedINIData = ref (' ' );
279
306
280
307
const selectedSystem = ref (' linux' );
@@ -286,6 +313,9 @@ const spcCommand = computed(() => {
286
313
case ' native' :
287
314
return ' bin/spc' ;
288
315
case ' spc' :
316
+ if (selectedSystem .value === ' windows' ) {
317
+ return ' .\\ spc.exe' ;
318
+ }
289
319
return ' ./spc' ;
290
320
case ' docker' :
291
321
return ' bin/spc-alpine-docker' ;
@@ -334,6 +364,11 @@ const calculateExtDepends = (input) => {
334
364
if (depends .length === 0 ) {
335
365
return ;
336
366
}
367
+ } else if (selectedSystem .value === ' windows' ) {
368
+ depends = ext .value [node ][' ext-depends-windows' ] ?? ext .value [node ][' ext-depends' ] ?? [];
369
+ if (depends .length === 0 ) {
370
+ return ;
371
+ }
337
372
}
338
373
339
374
depends .forEach ((dep ) => {
@@ -364,6 +399,11 @@ const calculateExtLibDepends = (input) => {
364
399
if (depends .length === 0 ) {
365
400
return ;
366
401
}
402
+ } else if (selectedSystem .value === ' windows' ) {
403
+ depends = lib .value [node ][' lib-depends-windows' ] ?? lib .value [node ][' lib-depends' ] ?? [];
404
+ if (depends .length === 0 ) {
405
+ return ;
406
+ }
367
407
}
368
408
369
409
depends .forEach ((dep ) => {
@@ -385,6 +425,11 @@ const calculateExtLibDepends = (input) => {
385
425
if (depends .length === 0 ) {
386
426
return ;
387
427
}
428
+ } else if (selectedSystem .value === ' windows' ) {
429
+ depends = ext .value [node ][' lib-depends-windows' ] ?? ext .value [node ][' lib-depends' ] ?? [];
430
+ if (depends .length === 0 ) {
431
+ return ;
432
+ }
388
433
}
389
434
390
435
depends .forEach ((dep ) => {
0 commit comments