mirror of
https://github.com/Ed94/pikuma_ps1.git
synced 2026-06-01 18:41:13 -07:00
prepping C-toolchain
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ if ((test-path $path_build) -eq $false) {
|
||||
new-item -itemtype directory -path $path_build
|
||||
}
|
||||
|
||||
$armips = join-path $path_toolchain 'armips/armips.exe'
|
||||
$armips = join-path $path_toolchain 'armips/build/Debug/armips.exe'
|
||||
$bin2exe_lua = join-path $path_scripts 'bin2exe.lua'
|
||||
$bin2exe_py = join-path $path_scripts 'bin2exe.py'
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
function clone-gitrepo { param( [string] $path, [string] $url )
|
||||
if (test-path $path) {
|
||||
# git -C $path pull
|
||||
}
|
||||
else {
|
||||
Write-Host "Cloning $url ..."
|
||||
git clone --recursive $url $path
|
||||
}
|
||||
}
|
||||
|
||||
function Update-GitRepo
|
||||
{
|
||||
param( [string] $path, [string] $url, [string] $build_command )
|
||||
|
||||
if ( $build_command -eq $null ) {
|
||||
write-host "Attempted to call Update-GitRepo without build_command specified"
|
||||
return
|
||||
}
|
||||
|
||||
$repo_name = $url.Split('/')[-1].Replace('.git', '')
|
||||
|
||||
$last_built_commit = join-path $path_build "last_built_commit_$repo_name.txt"
|
||||
if ( -not(test-path -Path $path))
|
||||
{
|
||||
write-host "Cloining repo from $url to $path"
|
||||
git clone $url $path
|
||||
|
||||
write-host "Building $url"
|
||||
push-location $path
|
||||
& "$build_command"
|
||||
pop-location
|
||||
|
||||
git -C $path rev-parse HEAD | out-file $last_built_commit
|
||||
$script:binaries_dirty = $true
|
||||
write-host
|
||||
return
|
||||
}
|
||||
|
||||
git -C $path fetch
|
||||
$latest_commit_hash = git -C $path rev-parse '@{u}'
|
||||
$last_built_hash = if (Test-Path $last_built_commit) { Get-Content $last_built_commit } else { "" }
|
||||
|
||||
if ( $latest_commit_hash -eq $last_built_hash ) {
|
||||
write-host
|
||||
return
|
||||
}
|
||||
|
||||
write-host "Build out of date for: $path, updating"
|
||||
write-host 'Pulling...'
|
||||
git -C $path pull
|
||||
|
||||
write-host "Building $url"
|
||||
push-location $path
|
||||
& $build_command
|
||||
pop-location
|
||||
|
||||
$latest_commit_hash | out-file $last_built_commit
|
||||
$script:binaries_dirty = $true
|
||||
write-host
|
||||
}
|
||||
|
||||
function verify-path { param( $path )
|
||||
if (test-path $path) {return $true}
|
||||
|
||||
new-item -ItemType Directory -Path $path
|
||||
return $false
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
$path_root = split-path -Path $PSScriptRoot -Parent
|
||||
$path_build = join-path $path_root 'build'
|
||||
$path_code = join-path $path_root 'code'
|
||||
$path_scripts = join-path $path_root 'scripts'
|
||||
$path_toolchain = join-path $path_root 'toolchain'
|
||||
|
||||
$misc = join-path $PSScriptRoot 'helpers/misc.ps1'
|
||||
. $misc
|
||||
|
||||
$url_armips = 'https://github.com/Kingcom/armips.git'
|
||||
$url_pcsx_redux = 'https://github.com/grumpycoders/pcsx-redux.git'
|
||||
|
||||
$path_armips = join-path $path_toolchain 'armips'
|
||||
$path_pcsx_redux = join-path $path_toolchain 'pcsx_redux'
|
||||
|
||||
clone-gitrepo $path_armips $url_armips
|
||||
clone-gitrepo $path_pcsx_redux $url_pcsx_redux
|
||||
|
||||
$path_armips_build = join-path $path_armips 'build'
|
||||
verify-path $path_armips_build
|
||||
push-location $path_armips_build
|
||||
& cmake ..
|
||||
& cmake --build . --config Debug
|
||||
pop-location
|
||||
Reference in New Issue
Block a user