Browse Source

cmExportFileGenerator: add target property for managed targets

Michael Stürmer 7 năm trước cách đây
mục cha
commit
20e31fb4c9
1 tập tin đã thay đổi với 14 bổ sung0 xóa
  1. 14 0
      Source/cmExportFileGenerator.cxx

+ 14 - 0
Source/cmExportFileGenerator.cxx

@@ -777,6 +777,20 @@ void cmExportFileGenerator::SetImportDetailProperties(
       properties[prop] = m.str();
     }
   }
+
+  // Add information if this target is a managed target
+  if (target->GetManagedType(config) !=
+      cmGeneratorTarget::ManagedType::Native) {
+    std::string prop = "IMPORTED_COMMON_LANGUAGE_RUNTIME";
+    prop += suffix;
+    std::string propval;
+    if (auto* p = target->GetProperty("COMMON_LANGUAGE_RUNTIME")) {
+      propval = p;
+    }
+    // TODO: make sure propval is set to non-empty string for
+    //       CSharp targets (i.e. force ManagedType::Managed).
+    properties[prop] = propval;
+  }
 }
 
 template <typename T>