forked from qt-creator/qt-creator
Remove '-flto' from clangd compiler command line by default
Linker-time-optimization flag should not have any effect on clangd, so we may remove it from the compiler command line by default when feeding clangd with the source files. gcc supports the optimization level that should be applied for the relative binaries. The level can be specified as the number N following by the -flto=[N] argument. clangd meanwhile doesn't know about this option and throws the 'Unsupported argument '1' to option '-flto=' error. Task-number: QTMCU-163 Change-Id: I540438d8f4d006261e4cfda2bbba91984352db9d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -875,7 +875,8 @@ void CompilerOptionsBuilder::evaluateCompilerFlags()
|
|||||||
|| option.startsWith("/M", Qt::CaseSensitive)
|
|| option.startsWith("/M", Qt::CaseSensitive)
|
||||||
|| option.startsWith(includeUserPathOption)
|
|| option.startsWith(includeUserPathOption)
|
||||||
|| option.startsWith(includeSystemPathOption)
|
|| option.startsWith(includeSystemPathOption)
|
||||||
|| option.startsWith(includeUserPathOptionWindows)) {
|
|| option.startsWith(includeUserPathOptionWindows)
|
||||||
|
|| option.startsWith("-flto")) {
|
||||||
// Optimization and run-time flags.
|
// Optimization and run-time flags.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user