ソースを参照

cmTarget: Remove some of the INTERFACE_LIBRARY whitelisted properties.

There is no need to allow EXCLUDE_* properties, because an
INTERFACE_LIBRARY has no direct build output.

IMPORTED_LINK_INTERFACE_LANGUAGES are relevant only to static
libraries.

VERSION is relevant only to the filename of direct build outputs,
which INTERFACE_LIBRARY does not have.
Stephen Kelly 12 年 前
コミット
fa651c7a19
2 ファイル変更10 行追加9 行削除
  1. 2 1
      Source/cmGlobalXCodeGenerator.cxx
  2. 8 8
      Source/cmTarget.cxx

+ 2 - 1
Source/cmGlobalXCodeGenerator.cxx

@@ -488,7 +488,8 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
                                                     dir.c_str());
         }
 
-      if(!target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
+      if(target.GetType() != cmTarget::INTERFACE_LIBRARY
+          && !target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
         {
         allbuild->AddUtility(target.GetName());
         }

+ 8 - 8
Source/cmTarget.cxx

@@ -1403,14 +1403,10 @@ static bool whiteListedInterfaceProperty(const char *prop)
     "COMPATIBLE_INTERFACE_NUMBER_MAX",
     "COMPATIBLE_INTERFACE_NUMBER_MIN",
     "COMPATIBLE_INTERFACE_STRING",
-    "EXCLUDE_FROM_ALL",
-    "EXCLUDE_FROM_DEFAULT_BUILD",
     "EXPORT_NAME",
-    "IMPORTED_LINK_INTERFACE_LANGUAGES",
     "IMPORTED",
     "NAME",
-    "TYPE",
-    "VERSION"
+    "TYPE"
   };
 
   if (std::binary_search(cmArrayBegin(builtIns),
@@ -1421,9 +1417,7 @@ static bool whiteListedInterfaceProperty(const char *prop)
     return true;
     }
 
-  if (cmHasLiteralPrefix(prop, "EXCLUDE_FROM_DEFAULT_BUILD_")
-      || cmHasLiteralPrefix(prop, "IMPORTED_LINK_INTERFACE_LANGUAGES_")
-      || cmHasLiteralPrefix(prop, "MAP_IMPORTED_CONFIG_"))
+  if (cmHasLiteralPrefix(prop, "MAP_IMPORTED_CONFIG_"))
     {
     return true;
     }
@@ -2576,6 +2570,8 @@ void cmTarget::GetTargetVersion(bool soversion,
   minor = 0;
   patch = 0;
 
+  assert(this->GetType() != INTERFACE_LIBRARY);
+
   // Look for a VERSION or SOVERSION property.
   const char* prop = soversion? "SOVERSION" : "VERSION";
   if(const char* version = this->GetProperty(prop))
@@ -3588,6 +3584,8 @@ void cmTarget::GetLibraryNames(std::string& name,
     return;
     }
 
+  assert(this->GetType() != INTERFACE_LIBRARY);
+
   // Check for library version properties.
   const char* version = this->GetProperty("VERSION");
   const char* soversion = this->GetProperty("SOVERSION");
@@ -4163,6 +4161,8 @@ std::string cmTarget::GetOutputName(const char* config, bool implib) const
 //----------------------------------------------------------------------------
 std::string cmTarget::GetFrameworkVersion() const
 {
+  assert(this->GetType() != INTERFACE_LIBRARY);
+
   if(const char* fversion = this->GetProperty("FRAMEWORK_VERSION"))
     {
     return fversion;