Skip to content

Commit

Permalink
Improve 1k scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Aug 7, 2024
1 parent 4efb362 commit cdb9fc7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions 1k/1kiss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ function setup_cmake($skipOS = $false, $scope = 'local') {
else {
& "$cmake_pkg_path" '--skip-license' '--prefix=/usr/local' 1>$null 2>$null
}
if (!$?) { Remove-Item $cmake_pkg_path -Force }
}

$cmake_prog, $_ = find_prog -name 'cmake' -path $cmake_bin -silent $true
Expand Down
8 changes: 7 additions & 1 deletion 1k/fetch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ function(_1kfetch_init)
set(_1kfetch_manifest "${_1kfetch_manifest}" CACHE STRING "" FORCE)
endif()

if(NOT EXISTS ${PWSH_PROG}) # try again
unset(PWSH_PROG CACHE)
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)
endif()

execute_process(COMMAND ${PWSH_PROG} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/resolv-uri.ps1
-name "1kdist"
-manifest ${_1kfetch_manifest}
OUTPUT_VARIABLE _1kdist_url
RESULT_VARIABLE _1kdist_error
)

if(_1kdist_url)
Expand All @@ -33,7 +39,7 @@ function(_1kfetch_init)
set(_1kdist_base_url "${_1kdist_base_url}/${_1kdist_ver}" PARENT_SCOPE)
set(_1kdist_ver ${_1kdist_ver} PARENT_SCOPE)
else()
message(WARNING "Resolve 1kdist uri fail, the _1kfetch_dist will not work")
message(WARNING "Resolve 1kdist uri fail, ${_1kdist_error}, the _1kfetch_dist will not work")
endif()
endfunction()

Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Foreach ($lib_name in $libs) {
$patches = Get-ChildItem (Split-Path $patch_script -Parent) -Filter '*.patch'
foreach($patch_file in $patches) {
println "apply patch: $patch_file"
git -C $lib_src apply --verbose $patch_file
git -C $lib_src apply --verbose --ignore-whitespace $patch_file
}
}

Expand Down

0 comments on commit cdb9fc7

Please sign in to comment.