setup-cpp/src/gcc
Kefu Chai 3d4cc40549 fix: use higher priority when installing llvm alternatives
before this change, gcc and g++ are installed using `updateAptAlternatives()`
with the same priority of 40 when they are installed along with
ld and libstdc++ as the dependencies of clang and llvm. but both
gcc and clang are installed using the same priority of 40 on ubuntu,
and the same applies to g++ and clang++. this renders it impossible
to use the default compilers of cc and cxx when clang/llvm is installed
using setup-cpp on an ubuntu host, as gcc is always prefered over
clang by the update-alternatives, as their priorities are identical.

in this change, the "priority" parameter is added to the setupGcc(),
so that we can specify a different priority when installing llvm.
strictly speaking, this is not necessary. as we can just use a higher
priority when calling updateAptAlternatives() in llvm/llvm.ts. but by
making it more explicit, we can ensure that we always prefer llvm over
gcc when installing llvm.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2024-01-22 14:25:47 +08:00
..
__tests__ fix: update execa 2023-04-22 02:19:33 -07:00
gcc.ts fix: use higher priority when installing llvm alternatives 2024-01-22 14:25:47 +08:00
gcc_matcher.json chore: update matcher names [skip ci] 2022-02-11 17:04:02 -08:00