Преглед на файлове

Refactor GetCompileDefinitions a bit.

It is now easier to add generator expressions.
Stephen Kelly преди 13 години
родител
ревизия
b8e61d687a
променени са 1 файла, в които са добавени 6 реда и са изтрити 6 реда
  1. 6 6
      Source/cmGeneratorTarget.cxx

+ 6 - 6
Source/cmGeneratorTarget.cxx

@@ -316,13 +316,13 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories()
 //----------------------------------------------------------------------------
 std::string cmGeneratorTarget::GetCompileDefinitions(const char *config)
 {
-  if (!config)
+  std::string defPropName = "COMPILE_DEFINITIONS";
+  if (config)
     {
-    return this->Target->GetProperty("COMPILE_DEFINITIONS");
+    defPropName += "_" + cmSystemTools::UpperCase(config);
     }
-  std::string defPropName = "COMPILE_DEFINITIONS_";
-  defPropName +=
-    cmSystemTools::UpperCase(config);
 
-  return this->Target->GetProperty(defPropName.c_str());
+  const char *prop = this->Target->GetProperty(defPropName.c_str());
+
+  return prop ? prop : "";
 }