Update Linux compiler selection with linker

Qmake attempts to invoke the linker with the default `g++` binary even
when we changed the binary. This will compile error when using LTO.

For clang:
```
/usr/bin/ld.gold: error: /usr/lib/llvm-3.8/bin/../lib/LLVMgold.so: could
not load plugin library: /usr/lib/llvm-3.8/bin/../lib/LLVMgold.so:
cannot open shared object file: No such file or directory
```

For GCC:
```
lto1: fatal error: bytecode stream generated with LTO version 6.0
instead of the expected 4.1
```
This commit is contained in:
Vasily
2020-04-12 00:52:31 +02:00
committed by username223
parent 7202230de3
commit 28b09e78f5
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -18,18 +18,22 @@ else {
message('clang' version is not above 4. Attempting to use highest specific version.)
system("clang-5 --version") {
QMAKE_CXX = clang-5
QMAKE_LINK = clang-5
message('clang-5' found.)
}
system("clang-6 --version") {
QMAKE_CXX = clang-6
QMAKE_LINK = clang-6
message('clang-6' found.)
}
system("clang-7 --version") {
QMAKE_CXX = clang-7
QMAKE_LINK = clang-7
message('clang-7' found.)
}
system("clang-8 --version") {
QMAKE_CXX = clang-8
QMAKE_LINK = clang-8
message('clang-8' found.)
}
}
+3
View File
@@ -7,14 +7,17 @@ else {
system(g++-7 --version) {
message('g++-7' found.)
QMAKE_CXX = g++-7
QMAKE_LINK = g++-7
}
system(g++-8 --version) {
message('g++-8' found.)
QMAKE_CXX = g++-8
QMAKE_LINK = g++-8
}
system(g++-9 --version) {
message('g++-9' found.)
QMAKE_CXX = g++-9
QMAKE_LINK = g++-9
}
}