Skip to content

Commit

Permalink
Update llvm install [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Dec 20, 2024
1 parent 9c2b980 commit a3efd2b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion 1k/1kiss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2026,12 +2026,12 @@ if (!$setupOnly) {
if (($cmake_generator -eq 'Xcode') -and !$BUILD_ALL_OPTIONS.Contains('--verbose')) {
$forward_options += '--', '-quiet'
}
$1k.println("cmake --build $BUILD_DIR $BUILD_ALL_OPTIONS")

if ($options.t) { $cmake_target = $options.t }
if ($cmake_target) {
$cmake_targets = $cmake_target.Split(',') | Sort-Object | Get-Unique
foreach ($target in $cmake_targets) {
$1k.println("cmake --build $BUILD_DIR $BUILD_ALL_OPTIONS --target $target")
cmake --build $BUILD_DIR $BUILD_ALL_OPTIONS --target $target $forward_options | Out-Host
if (!$?) {
Set-Location $stored_cwd
Expand All @@ -2040,6 +2040,7 @@ if (!$setupOnly) {
}
}
else {
$1k.println("cmake --build $BUILD_DIR $BUILD_ALL_OPTIONS")
cmake --build $BUILD_DIR $BUILD_ALL_OPTIONS $forward_options | Out-Host
if (!$?) {
Set-Location $stored_cwd
Expand Down
7 changes: 7 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ Foreach ($lib_name in $libs) {
}
}

if ($build_conf.repo.EndsWith('.git') -and $rebuild) {
git -C $lib_src clean -dfx -e _1kiss
}

$install_script = Join-Path $_1k_root "src/$lib_name/install1.ps1"
$has_custom_install = (Test-Path $install_script)

Expand Down Expand Up @@ -272,6 +276,9 @@ Foreach ($lib_name in $libs) {
. $custom_build_script $target_os $target_cpu $install_dir @forward_args
}
Pop-Location
if ($LASTEXITCODE) {
throw "Build $lib_name failed"
}

# custom install step
if ($has_custom_install) {
Expand Down
1 change: 0 additions & 1 deletion src/llvm/clean1.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ if ((Test-Path $install_dir -PathType Container)) {
sremove (Join-Path $install_dir 'include')
sremove (Join-Path $install_dir 'lib/*.lib')
sremove (Join-Path $install_dir 'lib/*.a')
sremove (Join-Path $install_dir 'bin/*.exe')
ls -R "$install_dir"
}
7 changes: 5 additions & 2 deletions src/llvm/install1.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
$install_dir = $args[0]
# $libsrc_dir = $args[1]

$artifact_path = @('Release\bin\libclang.dll', 'lib\libclang.so', 'Release\lib\libclang.dylib')[$HOST_OS]
$artifact_files = @(@('Release\bin\libclang.dll', 'Release\bin\clang-format.exe'), 'lib\libclang.so', 'Release\lib\libclang.dylib')[0]
$install_dest = (Join-Path $install_dir (@('lib', 'bin')[$IsWin]))
mkdirs $install_dest
Copy-Item (Join-Path $BUILD_DIR "$artifact_path") $install_dest

foreach($path in $artifact_files) {
Copy-Item (Join-Path $BUILD_DIR "$path") $install_dest
}

0 comments on commit a3efd2b

Please sign in to comment.