server-mode: Do not crash when running into INTERFACE_LIBRARY

Closes: #16539
This commit is contained in:
Tobias Hunger authored and Brad King committed 2017-01-09 16:40:46 -05:00
1 parent eee51e24d2
commit c0bd1eb6d0
1 file changed
+6 -2
+6 -2
View File
@@ -731,12 +731,16 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
Json::Value result = Json::objectValue;
result[kNAME_KEY] = target->GetName();
result[kTYPE_KEY] = typeName;
result[kFULL_NAME_KEY] = target->GetFullName(config);
result[kSOURCE_DIRECTORY_KEY] = lg->GetCurrentSourceDirectory();
result[kBUILD_DIRECTORY_KEY] = lg->GetCurrentBinaryDirectory();
if (type == cmStateEnums::INTERFACE_LIBRARY) {
return result;
}
result[kFULL_NAME_KEY] = target->GetFullName(config);
if (target->HaveWellDefinedOutputFiles()) {
Json::Value artifacts = Json::arrayValue;
artifacts.append(target->GetFullPath(config, false));