Skip to content

Commit cdb9fc7

Browse files
committed
Improve 1k scripts
1 parent 4efb362 commit cdb9fc7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

1k/1kiss.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@ function setup_cmake($skipOS = $false, $scope = 'local') {
904904
else {
905905
& "$cmake_pkg_path" '--skip-license' '--prefix=/usr/local' 1>$null 2>$null
906906
}
907+
if (!$?) { Remove-Item $cmake_pkg_path -Force }
907908
}
908909

909910
$cmake_prog, $_ = find_prog -name 'cmake' -path $cmake_bin -silent $true

1k/fetch.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ function(_1kfetch_init)
2020
set(_1kfetch_manifest "${_1kfetch_manifest}" CACHE STRING "" FORCE)
2121
endif()
2222

23+
if(NOT EXISTS ${PWSH_PROG}) # try again
24+
unset(PWSH_PROG CACHE)
25+
find_program(PWSH_PROG NAMES pwsh powershell NO_PACKAGE_ROOT_PATH NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH)
26+
endif()
27+
2328
execute_process(COMMAND ${PWSH_PROG} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/resolv-uri.ps1
2429
-name "1kdist"
2530
-manifest ${_1kfetch_manifest}
2631
OUTPUT_VARIABLE _1kdist_url
32+
RESULT_VARIABLE _1kdist_error
2733
)
2834

2935
if(_1kdist_url)
@@ -33,7 +39,7 @@ function(_1kfetch_init)
3339
set(_1kdist_base_url "${_1kdist_base_url}/${_1kdist_ver}" PARENT_SCOPE)
3440
set(_1kdist_ver ${_1kdist_ver} PARENT_SCOPE)
3541
else()
36-
message(WARNING "Resolve 1kdist uri fail, the _1kfetch_dist will not work")
42+
message(WARNING "Resolve 1kdist uri fail, ${_1kdist_error}, the _1kfetch_dist will not work")
3743
endif()
3844
endfunction()
3945

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Foreach ($lib_name in $libs) {
222222
$patches = Get-ChildItem (Split-Path $patch_script -Parent) -Filter '*.patch'
223223
foreach($patch_file in $patches) {
224224
println "apply patch: $patch_file"
225-
git -C $lib_src apply --verbose $patch_file
225+
git -C $lib_src apply --verbose --ignore-whitespace $patch_file
226226
}
227227
}
228228

0 commit comments

Comments
 (0)