set up clang/clang++ symlinks

This commit is contained in:
Egor Tensin 2021-09-05 21:52:59 +03:00
parent bbe81e2da0
commit 01d437c061
5 changed files with 24 additions and 13 deletions

View file

@ -1,5 +1,5 @@
name: Check cc/c++
description: Check cc/c++ (on Cygwin)
name: Check symlinks
description: Check symlinks (on Cygwin)
runs:
using: composite
steps:

View file

@ -1,5 +1,5 @@
name: Check cc/c++
description: Check cc/c++
name: Check symlinks
description: Check symlinks
inputs:
version:
description: Specific version to check
@ -28,5 +28,7 @@ runs:
}
Check-Exe cc
Check-Exe clang
Check-Exe c++
Check-Exe clang++
shell: pwsh

View file

@ -31,7 +31,7 @@ jobs:
uses: ./.github/actions/build-foo
- name: Run foo.exe
uses: ./.github/actions/run-foo
- name: Check cc/c++
- name: Check symlinks
uses: ./.github/actions/check-cc
versions:
@ -63,7 +63,7 @@ jobs:
binary: '${{ steps.setup.outputs.clangxx }}'
- name: Run foo.exe
uses: ./.github/actions/run-foo
- name: Check cc/c++
- name: Check symlinks
uses: ./.github/actions/check-cc
with:
version: '${{ matrix.version }}'
@ -99,9 +99,9 @@ jobs:
if: '!matrix.hardlinks'
- name: Run foo.exe
uses: ./.github/actions/run-foo
- name: Check cc/c++
- name: Check symlinks
uses: ./.github/actions/check-cc
if: matrix.hardlinks
- name: Check cc/c++ on Cygwin
- name: Check symlinks
uses: ./.github/actions/check-cc-cygwin
if: '!matrix.hardlinks'

View file

@ -39,8 +39,8 @@ API
| | *any* | | Install the i686 toolchain.
| cygwin | *any* | ✓ | Install native binaries.
| | 1 | | Install Cygwin packages.
| cc | 1 | ✓ | Set up `cc`/`c++` executables.
| | *any* | | Don't set up `cc`/`c++`.
| cc | 1 | ✓ | Set up `cc`/`clang`/`c++`/`clang++` executables.
| | *any* | | Don't set up the executables.
| hardlinks | *any* | ✓ | Cygwin: don't convert any symlinks.
| | 1 | | Cygwin: convert symlinks in /usr/bin to hardlinks.

View file

@ -15,7 +15,7 @@ inputs:
required: false
default: 0
cc:
description: Set up cc/c++ executables
description: Set up cc/clang/c++/clang++ executables
required: false
default: 1
hardlinks:
@ -211,6 +211,9 @@ runs:
New-Variable cc -Value ('${{ inputs.cc }}' -eq '1') -Option Constant
New-Variable clang -Value '${{ steps.install.outputs.clang }}' -Option Constant
New-Variable clangxx -Value '${{ steps.install.outputs.clangxx }}' -Option Constant
function Link-Exe {
param(
[Parameter(Mandatory=$true)]
@ -234,8 +237,14 @@ runs:
}
if ($cc) {
Link-Exe '${{ steps.install.outputs.clang }}' cc
Link-Exe '${{ steps.install.outputs.clangxx }}' c++
Link-Exe $clang cc
if ($clang -ne 'clang') {
Link-Exe $clang 'clang'
}
Link-Exe $clangxx c++
if ($clangxx -ne 'clang++') {
Link-Exe $clangxx 'clang++'
}
}
shell: pwsh