aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-01-04 13:41:55 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-01-04 13:41:55 +0300
commit63c28353f5db9a00944aad8f6081693fcfae772b (patch)
tree3d194095030ff7b8f4735ea72b044f756af7d418
parentreplace Fix-CygwinLink with a shorter bash script (diff)
downloadsetup-clang-63c28353f5db9a00944aad8f6081693fcfae772b.tar.gz
setup-clang-63c28353f5db9a00944aad8f6081693fcfae772b.zip
refactoring
-rw-r--r--action.yml20
1 files changed, 11 insertions, 9 deletions
diff --git a/action.yml b/action.yml
index 75b658e..cec9ed1 100644
--- a/action.yml
+++ b/action.yml
@@ -93,9 +93,6 @@ runs:
$pkgs = 'clang','g++-multilib','llvm'
}
Install-Package $pkgs
-
- Link-Exe -Exe clang -LinkName cc
- Link-Exe -Exe clang++ -LinkName c++
} elseif ($cygwin_host) {
if (!$x64) {
echo @'
@@ -111,17 +108,11 @@ runs:
# is required; it's simpler to install gcc-g++ for all the
# dependencies.
Install-Package clang gcc-g++ libiconv-devel llvm
-
- Link-Exe -Exe clang -LinkName cc
- Link-Exe -Exe clang++ -LinkName c++
} elseif ($windows_host) {
Install-Package llvm
$bin_dir = Join-Path $env:ProgramFiles LLVM bin
echo $bin_dir >> $env:GITHUB_PATH
-
- Link-Exe -Exe (Join-Path $bin_dir clang) -LinkName cc
- Link-Exe -Exe (Join-Path $bin_dir clang++) -LinkName c++
} else {
throw "Sorry, installing Clang is unsupported on $os"
}
@@ -144,6 +135,17 @@ runs:
done < <( find /usr/bin -type l -a '-(' -iname 'clang*' -o -iname 'llvm*' '-)' -print0 )
'@ | & bash.exe --login -o errexit -o nounset -o pipefail -o igncr
}
+
+ if ($linux_host) {
+ Link-Exe -Exe clang -LinkName cc
+ Link-Exe -Exe clang++ -LinkName c++
+ } elseif ($cygwin_host) {
+ Link-Exe -Exe clang -LinkName cc
+ Link-Exe -Exe clang++ -LinkName c++
+ } elseif ($windows_host) {
+ Link-Exe -Exe (Join-Path $bin_dir clang) -LinkName cc
+ Link-Exe -Exe (Join-Path $bin_dir clang++) -LinkName c++
+ }
shell: pwsh
branding: