@@ -89,7 +89,7 @@ $compatMode = $false
89
89
if ($Global :IsWin ) {
90
90
if (! $OutputEncoding -or $OutputEncoding.CodePage -ne 65001 ) {
91
91
$OutputEncoding = [System.Text.Encoding ]::UTF8
92
- try {
92
+ try {
93
93
[System.Console ]::OutputEncoding = $OutputEncoding
94
94
}
95
95
catch {
@@ -145,10 +145,10 @@ class _1kiss {
145
145
}
146
146
}
147
147
[void ] addpath([string ]$path ) { $this.addpath ($path , $false ) }
148
- [void ] addpath([string ]$path , [bool ]$append ) {
148
+ [void ] addpath([string ]$path , [bool ]$append ) {
149
149
if (! $path -or $env: PATH.Contains ($path )) { return }
150
- if (! $append ) { $env: PATH = " $path$Global :ENV_PATH_SEP$env: PATH " }
151
- else { $env: PATH = " $env: PATH$Global :ENV_PATH_SEP$path " }
150
+ if (! $append ) { $env: PATH = " $path$Global :ENV_PATH_SEP$env: PATH " }
151
+ else { $env: PATH = " $env: PATH$Global :ENV_PATH_SEP$path " }
152
152
}
153
153
154
154
[void ] pause($msg ) {
@@ -766,9 +766,9 @@ function download_and_expand($url, $out, $dest) {
766
766
}
767
767
}
768
768
769
- function resolve_path ($path , $prefix = $null ) {
770
- if ($1k.isabspath ($path )) {
771
- return $path
769
+ function resolve_path ($path , $prefix = $null ) {
770
+ if ($1k.isabspath ($path )) {
771
+ return $path
772
772
}
773
773
else {
774
774
if (! $prefix ) { $prefix = $install_prefix }
@@ -812,7 +812,7 @@ function fetch_pkg($url, $out = $null, $exrep = $null, $prefix = $null) {
812
812
else {
813
813
$prefix = $install_prefix
814
814
}
815
-
815
+
816
816
download_and_expand $url $out $prefix
817
817
818
818
if ($pfn_rename ) { & $pfn_rename }
@@ -835,7 +835,7 @@ function find_vs() {
835
835
836
836
$required_vs_ver = $manifest [' vs' ]
837
837
if (! $required_vs_ver ) { $required_vs_ver = ' 12.0+' }
838
-
838
+
839
839
# refer: https://learn.microsoft.com/en-us/visualstudio/install/workload-and-component-ids?view=vs-2022
840
840
$require_comps = @ (' Microsoft.VisualStudio.Component.VC.Tools.x86.x64' , ' Microsoft.VisualStudio.Product.BuildTools' )
841
841
$vs_installs = ConvertFrom-Json " $ ( & $VSWHERE_EXE - version $required_vs_ver.TrimEnd (' +' ) - format ' json' - requires $require_comps - requiresAny - prerelease) "
@@ -1035,7 +1035,12 @@ function setup_cmake($skipOS = $false) {
1035
1035
$cmake_app_contents = Join-Path $cmake_dir ' CMake.app/Contents'
1036
1036
}
1037
1037
if (! $1k.isdir ($cmake_dir )) {
1038
- fetch_pkg $cmake_url
1038
+ if ($IsLinux ) {
1039
+ fetch_pkg $cmake_url - out $cmake_pkg_path
1040
+ }
1041
+ else {
1042
+ fetch_pkg $cmake_url
1043
+ }
1039
1044
}
1040
1045
1041
1046
if ($1k.isdir ($cmake_dir )) {
@@ -1072,7 +1077,7 @@ function setup_cmake($skipOS = $false) {
1072
1077
1073
1078
$1k.println (" Using cmake: $cmake_prog , version: $cmake_ver " )
1074
1079
}
1075
-
1080
+
1076
1081
$1k.addpath ($cmake_bin )
1077
1082
return $cmake_prog , $cmake_ver
1078
1083
}
@@ -1342,9 +1347,9 @@ function setup_android_sdk() {
1342
1347
# - https://ci.android.com/builds/submitted/12186248/win64/latest/android-ndk-12186248-windows-x86_64.zip
1343
1348
# - https://ci.android.com/builds/submitted/12186248/linux/latest/android-ndk-12186248-linux-x86_64.zip
1344
1349
# - https://ci.android.com/builds/submitted/12186248/darwin_mac/latest/android-ndk-12186248-darwin-x86_64.zip
1345
-
1350
+
1346
1351
$1k.println (" Not found suitable android ndk, installing from ci.android.com ..." )
1347
-
1352
+
1348
1353
$_artifact = @ (" android-ndk-${ndk_r23d_rev} -windows-x86_64.zip" ,
1349
1354
" android-ndk-${ndk_r23d_rev} -linux-x86_64.zip" ,
1350
1355
" android-ndk-${ndk_r23d_rev} -darwin-x86_64.zip" ).Get($HOST_OS )
@@ -1358,7 +1363,7 @@ function setup_android_sdk() {
1358
1363
}
1359
1364
else {
1360
1365
$1k.println (" Not found suitable android ndk, installing ndk-$ndk_ver by sdkmanager ..." )
1361
-
1366
+
1362
1367
$matchInfos = (exec_prog - prog $sdkmanager_prog - params " --sdk_root=$sdk_root " , ' --list' | Select-String ' ndk;' )
1363
1368
if ($null -ne $matchInfos -and $matchInfos.Count -gt 0 ) {
1364
1369
$ndks = @ {}
@@ -1393,7 +1398,7 @@ function setup_android_sdk() {
1393
1398
}
1394
1399
}
1395
1400
}
1396
-
1401
+
1397
1402
if ($sdk_comps ) {
1398
1403
$sdk_cmdline_args = ' --verbose' , " --sdk_root=$sdk_root "
1399
1404
$sdk_cmdline_args += $sdk_comps
@@ -2055,7 +2060,7 @@ if (!$setupOnly) {
2055
2060
# apply additional build options
2056
2061
$BUILD_ALL_OPTIONS += " --parallel" , " $ ( $options.j ) "
2057
2062
2058
-
2063
+
2059
2064
$1k.println (" BUILD_ALL_OPTIONS=$BUILD_ALL_OPTIONS , Count={0}" -f $BUILD_ALL_OPTIONS.Count )
2060
2065
2061
2066
# forward non-cmake args to underlaying build toolchain, must at last
@@ -2101,7 +2106,7 @@ if (!$setupOnly) {
2101
2106
exit $LASTEXITCODE
2102
2107
}
2103
2108
}
2104
-
2109
+
2105
2110
if ($options.i ) {
2106
2111
$install_args = @ ($BUILD_DIR , ' --config' , $optimize_flag )
2107
2112
cmake -- install $install_args | Out-Host
0 commit comments