Просмотр исходного кода

cmTargetPropCommandBase: skip property setting if there's nothing to add

Some target types don't allow setting certain properties even if there
is no value being set there. Guard against this by avoiding property
setting when there is nothing to add.
Ben Boeckel 7 лет назад
Родитель
Сommit
9f64974f5e
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      Source/cmTargetPropCommandBase.cxx

+ 3 - 0
Source/cmTargetPropCommandBase.cxx

@@ -112,6 +112,9 @@ bool cmTargetPropCommandBase::PopulateTargetProperies(
   const std::string& scope, const std::vector<std::string>& content,
   bool prepend, bool system)
 {
+  if (content.empty()) {
+    return true;
+  }
   if (scope == "PRIVATE" || scope == "PUBLIC") {
     if (!this->HandleDirectContent(this->Target, content, prepend, system)) {
       return false;