forked from qt-creator/qt-creator
McuSupport: Avoid empty string for cmake toolchain vars
At the first run of Qt Creator after its installation, MSVC toolchain
command is set lazily after it's detected, so an empty string can be
set to cmake toolchain variable when a Qt for MCUs kit is created
automatically. It needs be avoided to keep the cmake variables valid.
Even when the command is not updated, it will work correctly with the
default variale (%{Compiler:Executable:(C,CXX)}).
Task-number: QTCREATORBUG-28457
Change-Id: I5de277831e7f1e696f67724193938d6eef7a12dd
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -259,10 +259,13 @@ public:
|
||||
ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
||||
|
||||
if (cToolchain && cxxToolchain) {
|
||||
if (!cxxToolchain->compilerCommand().isEmpty()
|
||||
&& !cToolchain->compilerCommand().isEmpty()) {
|
||||
configMap.insert("CMAKE_CXX_COMPILER",
|
||||
cxxToolchain->compilerCommand().toString().toLatin1());
|
||||
configMap.insert("CMAKE_C_COMPILER",
|
||||
cToolchain->compilerCommand().toString().toLatin1());
|
||||
}
|
||||
} else {
|
||||
printMessage(Tr::tr("Warning for target %1: invalid toolchain path (%2). "
|
||||
"Update the toolchain in Edit > Preferences > Kits.")
|
||||
|
||||
Reference in New Issue
Block a user