diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 9fbeb73176f..a83e814a300 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -263,8 +263,10 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor if (toolchain.contains(QLatin1String("msvc"))) { data.insert(QLatin1String(CPP_COMPILERNAME), mainCompilerName); } else { - data.insert(QLatin1String(CPP_COMPILERNAME), cCompilerName); - data.insert(QLatin1String(CPP_CXXCOMPILERNAME), cxxCompilerName); + if (!cCompilerName.isEmpty()) + data.insert(QLatin1String(CPP_COMPILERNAME), cCompilerName); + if (!cxxCompilerName.isEmpty()) + data.insert(QLatin1String(CPP_CXXCOMPILERNAME), cxxCompilerName); } if (tcC && tcCxx && cFileInfo.absolutePath() != cxxFileInfo.absolutePath()) {