[Cmake-commits] CMake branch, next, updated. v3.4.0-rc1-776-gedb7311

Stephen Kelly steveire at gmail.com
Tue Oct 20 18:53:38 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  edb731113d63696ae691dfca207c2155129ff27c (commit)
       via  c099e00fc0a9c47a2addaca145952b1c33195fab (commit)
       via  d74bca5a8fee1d45c60b60a70a2a1a90abb74180 (commit)
       via  c6e86955086e1824cd666bc69c802d48074cc138 (commit)
       via  18046bd50a502508f170baa6cec5c81efb33f180 (commit)
       via  91411641a7b8029d05899b11590fb4e676716a85 (commit)
       via  6d94078e623d5f1316f1972ffda06ac1d66b6f2f (commit)
       via  3ebc62850c7461dca4723b063b5e5f019409db84 (commit)
       via  311018e5ad27abf7c76003ec91d3f26ef316e3cc (commit)
      from  d06f93ac425f3fc61720fb2752111457e4b56431 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=edb731113d63696ae691dfca207c2155129ff27c
commit edb731113d63696ae691dfca207c2155129ff27c
Merge: d06f93a c099e00
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 20 18:53:36 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Oct 20 18:53:36 2015 -0400

    Merge topic 'use-generator-target' into next
    
    c099e00f Access policy status from cmGeneratorTarget at generate time.
    d74bca5a cmGeneratorTarget: Copy the policy map from the cmTarget.
    c6e86955 cmTarget: Remove unused NameResolvesToFramework.
    18046bd5 cmCommonTargetGenerator: Use NameResolvesToFramework without cmTarget.
    91411641 Move ComputeLinkType out of cmTarget.
    6d94078e cmGeneratorTarget: Move IsDLLPlatform from cmTarget.
    3ebc6285 cmGeneratorTarget: Move HaveWellDefinedOutputFiles from cmTarget.
    311018e5 cmGeneratorTarget: Move GetExportMacro from cmTarget.


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c099e00fc0a9c47a2addaca145952b1c33195fab
commit c099e00fc0a9c47a2addaca145952b1c33195fab
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 20 01:12:37 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 21 00:52:23 2015 +0200

    Access policy status from cmGeneratorTarget at generate time.

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index eca0f66..a32bb48 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -407,7 +407,7 @@ cmComputeLinkInformation
   // order to support such projects we need to add the directories
   // containing libraries linked with a full path to the -L path.
   this->OldLinkDirMode =
-    this->Target->Target->GetPolicyStatusCMP0003() != cmPolicies::NEW;
+    this->Target->GetPolicyStatusCMP0003() != cmPolicies::NEW;
   if(this->OldLinkDirMode)
     {
     // Construct a mask to not bother with this behavior for link
@@ -1140,7 +1140,7 @@ void cmComputeLinkInformation::AddFullItem(std::string const& item)
   // Full path libraries should specify a valid library file name.
   // See documentation of CMP0008.
   std::string generator = this->GlobalGenerator->GetName();
-  if(this->Target->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW &&
+  if(this->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW &&
      (generator.find("Visual Studio") != generator.npos ||
       generator.find("Xcode") != generator.npos))
     {
@@ -1221,7 +1221,7 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(std::string const& item)
     }
 
   // Check the policy for whether we should use the approach below.
-  switch (this->Target->Target->GetPolicyStatusCMP0060())
+  switch (this->Target->GetPolicyStatusCMP0060())
     {
     case cmPolicies::WARN:
       if (this->CMP0060Warn)
@@ -1531,7 +1531,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
   this->OrderLinkerSearchPath->AddLinkLibrary(item);
 
   // Produce any needed message.
-  switch(this->Target->Target->GetPolicyStatusCMP0008())
+  switch(this->Target->GetPolicyStatusCMP0008())
     {
     case cmPolicies::WARN:
       {
@@ -1583,7 +1583,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
     }
 
   // Enforce policy constraints.
-  switch(this->Target->Target->GetPolicyStatusCMP0003())
+  switch(this->Target->GetPolicyStatusCMP0003())
     {
     case cmPolicies::WARN:
       if(!this->CMakeInstance->GetState()
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 2ae8084..03f4fdd 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -362,7 +362,7 @@ void cmComputeTargetDepends::AddTargetDepend(
     cmake::MessageType messageType = cmake::AUTHOR_WARNING;
     bool issueMessage = false;
     std::ostringstream e;
-    switch(depender->Target->GetPolicyStatusCMP0046())
+    switch(depender->GetPolicyStatusCMP0046())
       {
       case cmPolicies::WARN:
         e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0046) << "\n";
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index be65a19..23c11d7 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -107,8 +107,8 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
     this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
                                   gte, properties);
     const bool newCMP0022Behavior =
-        gte->Target->GetPolicyStatusCMP0022() != cmPolicies::WARN
-        && gte->Target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+        gte->GetPolicyStatusCMP0022() != cmPolicies::WARN
+        && gte->GetPolicyStatusCMP0022() != cmPolicies::OLD;
     if (newCMP0022Behavior)
       {
       this->PopulateInterfaceLinkLibrariesProperty(gte,
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index c542f85..1a84625 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -270,7 +270,7 @@ static bool checkInterfaceDirs(const std::string &prepro,
       {
       if (prop == "INTERFACE_INCLUDE_DIRECTORIES")
         {
-        switch (target->Target->GetPolicyStatusCMP0041())
+        switch (target->GetPolicyStatusCMP0041())
           {
           case cmPolicies::WARN:
             messageType = cmake::WARNING;
@@ -317,7 +317,7 @@ static bool checkInterfaceDirs(const std::string &prepro,
         {
         if (!shouldContinue)
           {
-          switch(target->Target->GetPolicyStatusCMP0052())
+          switch(target->GetPolicyStatusCMP0052())
             {
             case cmPolicies::WARN:
               {
@@ -830,10 +830,8 @@ cmExportFileGenerator
     }
 
   const bool newCMP0022Behavior =
-                        target->Target
-                              ->GetPolicyStatusCMP0022() != cmPolicies::WARN
-                     && target->Target
-                              ->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+                        target->GetPolicyStatusCMP0022() != cmPolicies::WARN
+                     && target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
 
   if(newCMP0022Behavior && !this->ExportOld)
     {
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index a2d6ad1..b695904 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -169,8 +169,8 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
                                   properties, missingTargets);
 
     const bool newCMP0022Behavior =
-        gt->Target->GetPolicyStatusCMP0022() != cmPolicies::WARN
-        && gt->Target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+        gt->GetPolicyStatusCMP0022() != cmPolicies::WARN
+        && gt->GetPolicyStatusCMP0022() != cmPolicies::OLD;
     if (newCMP0022Behavior)
       {
       if (this->PopulateInterfaceLinkLibrariesProperty(gt,
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index fc5c049..713ab6a 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1498,7 +1498,7 @@ bool cmGeneratorTarget::MacOSXRpathInstallNameDirDefault() const
     return this->GetPropertyAsBool("MACOSX_RPATH");
     }
 
-  cmPolicies::PolicyStatus cmp0042 = this->Target->GetPolicyStatusCMP0042();
+  cmPolicies::PolicyStatus cmp0042 = this->GetPolicyStatusCMP0042();
 
   if(cmp0042 == cmPolicies::WARN)
     {
@@ -2635,7 +2635,7 @@ static void processIncludeDirectories(cmGeneratorTarget const* tgt,
         cmake::MessageType messageType = cmake::FATAL_ERROR;
         if (checkCMP0027)
           {
-          switch(tgt->Target->GetPolicyStatusCMP0027())
+          switch(tgt->GetPolicyStatusCMP0027())
             {
             case cmPolicies::WARN:
               e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0027) << "\n";
@@ -2674,7 +2674,7 @@ static void processIncludeDirectories(cmGeneratorTarget const* tgt,
           }
         else
           {
-          switch(tgt->Target->GetPolicyStatusCMP0021())
+          switch(tgt->GetPolicyStatusCMP0021())
             {
             case cmPolicies::WARN:
               {
@@ -4706,8 +4706,8 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
         }
       }
     }
-  else if (this->Target->GetPolicyStatusCMP0022() == cmPolicies::WARN
-        || this->Target->GetPolicyStatusCMP0022() == cmPolicies::OLD)
+  else if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN
+        || this->GetPolicyStatusCMP0022() == cmPolicies::OLD)
     {
     // The link implementation is the default link interface.
     cmLinkImplementationLibraries const*
@@ -5075,8 +5075,8 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries(
   // libraries and executables that export symbols.
   const char* explicitLibraries = 0;
   std::string linkIfaceProp;
-  if(this->Target->GetPolicyStatusCMP0022() != cmPolicies::OLD &&
-     this->Target->GetPolicyStatusCMP0022() != cmPolicies::WARN)
+  if(this->GetPolicyStatusCMP0022() != cmPolicies::OLD &&
+     this->GetPolicyStatusCMP0022() != cmPolicies::WARN)
     {
     // CMP0022 NEW behavior is to use INTERFACE_LINK_LIBRARIES.
     linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
@@ -5102,7 +5102,7 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries(
     }
 
   if(explicitLibraries &&
-     this->Target->GetPolicyStatusCMP0022() == cmPolicies::WARN &&
+     this->GetPolicyStatusCMP0022() == cmPolicies::WARN &&
      !this->PolicyWarnedCMP0022)
     {
     // Compare the explicitly set old link interface properties to the
@@ -5147,8 +5147,8 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries(
                                 iface.Libraries,
                                 iface.HadHeadSensitiveCondition);
     }
-  else if (this->Target->GetPolicyStatusCMP0022() == cmPolicies::WARN
-        || this->Target->GetPolicyStatusCMP0022() == cmPolicies::OLD)
+  else if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN
+        || this->GetPolicyStatusCMP0022() == cmPolicies::OLD)
     // If CMP0022 is NEW then the plain tll signature sets the
     // INTERFACE_LINK_LIBRARIES, so if we get here then the project
     // cleared the property explicitly and we should not fall back
@@ -5159,7 +5159,7 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries(
       this->GetLinkImplementationLibrariesInternal(config, headTarget);
     iface.Libraries.insert(iface.Libraries.end(),
                            impl->Libraries.begin(), impl->Libraries.end());
-    if(this->Target->GetPolicyStatusCMP0022() == cmPolicies::WARN &&
+    if(this->GetPolicyStatusCMP0022() == cmPolicies::WARN &&
        !this->PolicyWarnedCMP0022 && !usage_requirements_only)
       {
       // Compare the link implementation fallback link interface to the
@@ -5621,7 +5621,7 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const
   if(lib != item)
     {
     cmake* cm = this->LocalGenerator->GetCMakeInstance();
-    switch(this->Target->GetPolicyStatusCMP0004())
+    switch(this->GetPolicyStatusCMP0004())
       {
       case cmPolicies::WARN:
         {
@@ -5829,7 +5829,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
           bool noMessage = false;
           cmake::MessageType messageType = cmake::FATAL_ERROR;
           std::ostringstream e;
-          switch(this->Target->GetPolicyStatusCMP0038())
+          switch(this->GetPolicyStatusCMP0038())
             {
             case cmPolicies::WARN:
               {
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index c65d9e0..93ddac0 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1551,7 +1551,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
         GetGlobalPropertyAsBool("TARGET_SUPPORTS_SHARED_LIBS"))
     {
     bool add_shlib_flags = false;
-    switch(tgt.Target->GetPolicyStatusCMP0065())
+    switch(tgt.GetPolicyStatusCMP0065())
       {
       case cmPolicies::WARN:
         if(!tgt.GetPropertyAsBool("ENABLE_EXPORTS") &&
@@ -2108,7 +2108,7 @@ void cmLocalGenerator
       target->GetType() != cmState::MODULE_LIBRARY &&
       !target->IsExecutableWithExports())
     {
-    switch (target->Target->GetPolicyStatusCMP0063())
+    switch (target->GetPolicyStatusCMP0063())
       {
       case cmPolicies::OLD:
         return;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d74bca5a8fee1d45c60b60a70a2a1a90abb74180
commit d74bca5a8fee1d45c60b60a70a2a1a90abb74180
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 20 01:05:42 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 21 00:52:23 2015 +0200

    cmGeneratorTarget: Copy the policy map from the cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2a35259..fc5c049 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -308,6 +308,8 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
   this->DLLPlatform = (this->Makefile->IsOn("WIN32") ||
                        this->Makefile->IsOn("CYGWIN") ||
                        this->Makefile->IsOn("MINGW"));
+
+  this->PolicyMap = t->PolicyMap;
 }
 
 cmGeneratorTarget::~cmGeneratorTarget()
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index eaec83b..2dc3a6f 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -33,6 +33,14 @@ public:
   bool IsImported() const;
   const char *GetLocation(const std::string& config) const;
 
+#define DECLARE_TARGET_POLICY(POLICY) \
+  cmPolicies::PolicyStatus GetPolicyStatus ## POLICY () const \
+    { return this->PolicyMap.Get(cmPolicies::POLICY); }
+
+  CM_FOR_EACH_TARGET_POLICY(DECLARE_TARGET_POLICY)
+
+#undef DECLARE_TARGET_POLICY
+
   /** Get the location of the target in the build tree with a placeholder
       referencing the configuration in the native build system.  This
       location is suitable for use as the LOCATION target property.  */
@@ -641,6 +649,7 @@ private:
   typedef std::map<OutputNameKey, std::string> OutputNameMapType;
   mutable OutputNameMapType OutputNameMap;
   mutable std::set<cmLinkItem> UtilityItems;
+  cmPolicies::PolicyMap PolicyMap;
   mutable bool PolicyWarnedCMP0022;
   mutable bool DebugIncludesDone;
   mutable bool DebugCompileOptionsDone;
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index a549d18..5023055 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -230,6 +230,23 @@ class cmPolicy;
 #define CM_FOR_EACH_POLICY_ID(POLICY) \
   CM_FOR_EACH_POLICY_TABLE(POLICY, CM_SELECT_ID)
 
+#define CM_FOR_EACH_TARGET_POLICY(F) \
+  F(CMP0003) \
+  F(CMP0004) \
+  F(CMP0008) \
+  F(CMP0020) \
+  F(CMP0021) \
+  F(CMP0022) \
+  F(CMP0027) \
+  F(CMP0038) \
+  F(CMP0041) \
+  F(CMP0042) \
+  F(CMP0046) \
+  F(CMP0052) \
+  F(CMP0060) \
+  F(CMP0063) \
+  F(CMP0065)
+
 
 /** \class cmPolicies
  * \brief Handles changes in CMake behavior and policies
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 8a99472..e8c05da 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -26,23 +26,6 @@
 # endif
 #endif
 
-#define CM_FOR_EACH_TARGET_POLICY(F) \
-  F(CMP0003) \
-  F(CMP0004) \
-  F(CMP0008) \
-  F(CMP0020) \
-  F(CMP0021) \
-  F(CMP0022) \
-  F(CMP0027) \
-  F(CMP0038) \
-  F(CMP0041) \
-  F(CMP0042) \
-  F(CMP0046) \
-  F(CMP0052) \
-  F(CMP0060) \
-  F(CMP0063) \
-  F(CMP0065)
-
 class cmake;
 class cmMakefile;
 class cmSourceFile;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6e86955086e1824cd666bc69c802d48074cc138
commit c6e86955086e1824cd666bc69c802d48074cc138
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 20 01:01:57 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 21 00:52:23 2015 +0200

    cmTarget: Remove unused NameResolvesToFramework.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0d8c57d..e056469 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -611,13 +611,6 @@ void cmTarget::ClearDependencyInformation( cmMakefile& mf,
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::NameResolvesToFramework(const std::string& libname) const
-{
-  return this->Makefile->GetGlobalGenerator()->
-    NameResolvesToFramework(libname);
-}
-
-//----------------------------------------------------------------------------
 std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value,
                                   cmTargetLinkLibraryType llt) const
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 9ed7f84..8a99472 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -145,8 +145,6 @@ public:
    */
   void ClearDependencyInformation(cmMakefile& mf, const std::string& target);
 
-  // Check to see if a library is a framework and treat it different on Mac
-  bool NameResolvesToFramework(const std::string& libname) const;
   void AddLinkLibrary(cmMakefile& mf,
                       const std::string& target, const std::string& lib,
                       cmTargetLinkLibraryType llt);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18046bd50a502508f170baa6cec5c81efb33f180
commit 18046bd50a502508f170baa6cec5c81efb33f180
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 20 01:01:21 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 21 00:52:22 2015 +0200

    cmCommonTargetGenerator: Use NameResolvesToFramework without cmTarget.

diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 1982bba..6920faf 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -265,7 +265,7 @@ std::string cmCommonTargetGenerator::GetFrameworkFlags(std::string const& l)
   for(std::vector<std::string>::iterator i = includes.begin();
       i != includes.end(); ++i)
     {
-    if(this->Target->NameResolvesToFramework(*i))
+    if(this->GlobalGenerator->NameResolvesToFramework(*i))
       {
       std::string frameworkDir = *i;
       frameworkDir += "/../";

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91411641a7b8029d05899b11590fb4e676716a85
commit 91411641a7b8029d05899b11590fb4e676716a85
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 20 00:57:35 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 21 00:52:22 2015 +0200

    Move ComputeLinkType out of cmTarget.
    
    Keep it out of the way, so that it does not become part of cmGeneratorTarget,
    but where it can be used to implement CMP0003.

diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 465db92..13098ad 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -185,7 +185,9 @@ cmComputeLinkDepends
   // The configuration being linked.
   this->HasConfig = !config.empty();
   this->Config = (this->HasConfig)? config : std::string();
-  this->LinkType = this->Target->Target->ComputeLinkType(this->Config);
+  std::vector<std::string> debugConfigs =
+    this->Makefile->GetCMakeInstance()->GetDebugConfigs();
+  this->LinkType = CMP0003_ComputeLinkType(this->Config, debugConfigs);
 
   // Enable debug mode if requested.
   this->DebugMode = this->Makefile->IsOn("CMAKE_LINK_DEPENDS_DEBUG_MODE");
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 6e312ce..2a35259 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5877,7 +5877,12 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
                                 this->MaxLanguageStandards);
     }
 
-  cmTargetLinkLibraryType linkType = this->Target->ComputeLinkType(config);
+  // Get the list of configurations considered to be DEBUG.
+  std::vector<std::string> debugConfigs =
+    this->Makefile->GetCMakeInstance()->GetDebugConfigs();
+
+  cmTargetLinkLibraryType linkType =
+      CMP0003_ComputeLinkType(config, debugConfigs);
   cmTarget::LinkLibraryVectorType const& oldllibs =
     this->Target->GetOriginalLinkLibraries();
   for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index b875cc0..b603bcc 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -14,6 +14,7 @@
 #define cmLinkItem_h
 
 #include "cmListFileCache.h"
+#include "cmSystemTools.h"
 
 class cmGeneratorTarget;
 
@@ -118,4 +119,27 @@ struct cmOptionalLinkImplementation: public cmLinkImplementation
   bool HadHeadSensitiveCondition;
 };
 
+/** Compute the link type to use for the given configuration.  */
+inline cmTargetLinkLibraryType
+CMP0003_ComputeLinkType(const std::string& config,
+                        std::vector<std::string> const& debugConfigs)
+{
+  // No configuration is always optimized.
+  if(config.empty())
+    {
+    return OPTIMIZED_LibraryType;
+    }
+
+  // Check if any entry in the list matches this configuration.
+  std::string configUpper = cmSystemTools::UpperCase(config);
+  if (std::find(debugConfigs.begin(), debugConfigs.end(), configUpper) !=
+      debugConfigs.end())
+    {
+    return DEBUG_LibraryType;
+    }
+  // The current configuration is not a debug configuration.
+  return OPTIMIZED_LibraryType;
+}
+
+
 #endif
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 63d3d07..0d8c57d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -583,31 +583,6 @@ const std::vector<std::string>& cmTarget::GetLinkDirectories() const
 }
 
 //----------------------------------------------------------------------------
-cmTargetLinkLibraryType cmTarget::ComputeLinkType(
-                                      const std::string& config) const
-{
-  // No configuration is always optimized.
-  if(config.empty())
-    {
-    return OPTIMIZED_LibraryType;
-    }
-
-  // Get the list of configurations considered to be DEBUG.
-  std::vector<std::string> debugConfigs =
-    this->Makefile->GetCMakeInstance()->GetDebugConfigs();
-
-  // Check if any entry in the list matches this configuration.
-  std::string configUpper = cmSystemTools::UpperCase(config);
-  if (std::find(debugConfigs.begin(), debugConfigs.end(), configUpper) !=
-      debugConfigs.end())
-    {
-    return DEBUG_LibraryType;
-    }
-  // The current configuration is not a debug configuration.
-  return OPTIMIZED_LibraryType;
-}
-
-//----------------------------------------------------------------------------
 void cmTarget::ClearDependencyInformation( cmMakefile& mf,
                                            const std::string& target )
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 33631e7..9ed7f84 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -140,9 +140,6 @@ public:
   const LinkLibraryVectorType &GetOriginalLinkLibraries() const
     {return this->OriginalLinkLibraries;}
 
-  /** Compute the link type to use for the given configuration.  */
-  cmTargetLinkLibraryType ComputeLinkType(const std::string& config) const;
-
   /**
    * Clear the dependency information recorded for this target, if any.
    */

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6d94078e623d5f1316f1972ffda06ac1d66b6f2f
commit 6d94078e623d5f1316f1972ffda06ac1d66b6f2f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 20 00:44:15 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 21 00:52:22 2015 +0200

    cmGeneratorTarget: Move IsDLLPlatform from cmTarget.

diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 1a878e2..7a7e4ff 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1579,7 +1579,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
                             const GeneratorExpressionContent *content)
   {
     // The target soname file (.so.1).
-    if(target->Target->IsDLLPlatform())
+    if(target->IsDLLPlatform())
       {
       ::reportError(context, content->GetOriginalExpression(),
                     "TARGET_SONAME_FILE is not allowed "
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 1483af7..6e312ce 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -304,6 +304,10 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
         t->GetSourceEntries(),
         t->GetSourceBacktraces(),
         this->SourceEntries, true);
+
+  this->DLLPlatform = (this->Makefile->IsOn("WIN32") ||
+                       this->Makefile->IsOn("CYGWIN") ||
+                       this->Makefile->IsOn("MINGW"));
 }
 
 cmGeneratorTarget::~cmGeneratorTarget()
@@ -366,7 +370,7 @@ const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
   switch(this->GetType())
     {
     case cmState::SHARED_LIBRARY:
-      if(this->Target->IsDLLPlatform())
+      if(this->IsDLLPlatform())
         {
         if(implib)
           {
@@ -2058,6 +2062,11 @@ cmGeneratorTarget::GetModuleDefinitionFile(const std::string& config) const
   return data;
 }
 
+bool cmGeneratorTarget::IsDLLPlatform() const
+{
+  return this->DLLPlatform;
+}
+
 //----------------------------------------------------------------------------
 void
 cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs,
@@ -5964,7 +5973,7 @@ bool cmGeneratorTarget::IsExecutableWithExports() const
 //----------------------------------------------------------------------------
 bool cmGeneratorTarget::HasImportLibrary() const
 {
-  return (this->Target->IsDLLPlatform() &&
+  return (this->IsDLLPlatform() &&
           (this->GetType() == cmState::SHARED_LIBRARY ||
            this->IsExecutableWithExports()));
 }
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 26b229d..eaec83b 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -196,6 +196,9 @@ public:
 
   std::string GetModuleDefinitionFile(const std::string& config) const;
 
+  /** Return whether or not the target is for a DLL platform.  */
+  bool IsDLLPlatform() const;
+
   /** @return whether this target have a well defined output file name. */
   bool HaveWellDefinedOutputFiles() const;
 
@@ -646,6 +649,7 @@ private:
   mutable bool DebugSourcesDone;
   mutable bool LinkImplementationLanguageIsContextDependent;
   mutable bool UtilityItemsDone;
+  bool DLLPlatform;
 
   bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
                            std::string& out) const;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 26f0d63..33631e7 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -224,9 +224,6 @@ public:
       enabled.  */
   bool IsExecutableWithExports() const;
 
-  /** Return whether or not the target is for a DLL platform.  */
-  bool IsDLLPlatform() const { return this->DLLPlatform; }
-
   /** Return whether this target is a shared library Framework on
       Apple.  */
   bool IsFrameworkOnApple() const;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3ebc62850c7461dca4723b063b5e5f019409db84
commit 3ebc62850c7461dca4723b063b5e5f019409db84
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 20 00:42:01 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 21 00:52:22 2015 +0200

    cmGeneratorTarget: Move HaveWellDefinedOutputFiles from cmTarget.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index f41243e..1483af7 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1709,6 +1709,16 @@ cmListFileBacktrace cmGeneratorTarget::GetBacktrace() const
 }
 
 //----------------------------------------------------------------------------
+bool cmGeneratorTarget::HaveWellDefinedOutputFiles() const
+{
+  return
+    this->GetType() == cmState::STATIC_LIBRARY ||
+    this->GetType() == cmState::SHARED_LIBRARY ||
+    this->GetType() == cmState::MODULE_LIBRARY ||
+    this->GetType() == cmState::EXECUTABLE;
+}
+
+//----------------------------------------------------------------------------
 const char* cmGeneratorTarget::GetExportMacro() const
 {
   // Define the symbol for targets that export symbols.
@@ -4819,7 +4829,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
     }
 
   // Only libraries and executables have well-defined output files.
-  if(!this->Target->HaveWellDefinedOutputFiles())
+  if(!this->HaveWellDefinedOutputFiles())
     {
     std::string msg = "cmGeneratorTarget::GetOutputInfo called for ";
     msg += this->GetName();
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index b32bfd9..26b229d 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -196,6 +196,9 @@ public:
 
   std::string GetModuleDefinitionFile(const std::string& config) const;
 
+  /** @return whether this target have a well defined output file name. */
+  bool HaveWellDefinedOutputFiles() const;
+
   /** Link information from the transitive closure of the link
       implementation and the interfaces of its dependencies.  */
   struct LinkClosure
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index 490759f..e9dc433 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -34,7 +34,7 @@ cmOSXBundleGenerator(cmGeneratorTarget* target,
 //----------------------------------------------------------------------------
 bool cmOSXBundleGenerator::MustSkip()
 {
-  return !this->GT->Target->HaveWellDefinedOutputFiles();
+  return !this->GT->HaveWellDefinedOutputFiles();
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 58dea03..63d3d07 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1560,16 +1560,6 @@ void cmTarget::MarkAsImported()
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::HaveWellDefinedOutputFiles() const
-{
-  return
-    this->GetType() == cmState::STATIC_LIBRARY ||
-    this->GetType() == cmState::SHARED_LIBRARY ||
-    this->GetType() == cmState::MODULE_LIBRARY ||
-    this->GetType() == cmState::EXECUTABLE;
-}
-
-//----------------------------------------------------------------------------
 bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
 {
   if (this->IsImported())
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 865bc8d..26f0d63 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -241,9 +241,6 @@ public:
   /** Get a backtrace from the creation of the target.  */
   cmListFileBacktrace const& GetBacktrace() const;
 
-  /** @return whether this target have a well defined output file name. */
-  bool HaveWellDefinedOutputFiles() const;
-
   void InsertInclude(std::string const& entry,
                      cmListFileBacktrace const& bt,
                      bool before = false);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=311018e5ad27abf7c76003ec91d3f26ef316e3cc
commit 311018e5ad27abf7c76003ec91d3f26ef316e3cc
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 19 22:42:01 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Oct 21 00:52:22 2015 +0200

    cmGeneratorTarget: Move GetExportMacro from cmTarget.

diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 41af89b..1982bba 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -349,7 +349,8 @@ std::string cmCommonTargetGenerator::GetDefines(const std::string &l)
     std::set<std::string> defines;
     const char *lang = l.c_str();
     // Add the export symbol definition for shared library objects.
-    if(const char* exportMacro = this->Target->GetExportMacro())
+    if(const char* exportMacro =
+       this->GeneratorTarget->GetExportMacro())
       {
       this->LocalGenerator->AppendDefines(defines, exportMacro);
       }
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index a6b14ba..ac0202b 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -427,7 +427,7 @@ ComputeDefines(cmSourceFile *source, cmLocalGenerator* lg,
   const std::string& config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
 
   // Add the export symbol definition for shared library objects.
-  if(const char* exportMacro = target->Target->GetExportMacro())
+  if(const char* exportMacro = target->GetExportMacro())
     {
     lg->AppendDefines(defines, exportMacro);
     }
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 0a1a364..f41243e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1709,6 +1709,32 @@ cmListFileBacktrace cmGeneratorTarget::GetBacktrace() const
 }
 
 //----------------------------------------------------------------------------
+const char* cmGeneratorTarget::GetExportMacro() const
+{
+  // Define the symbol for targets that export symbols.
+  if(this->GetType() == cmState::SHARED_LIBRARY ||
+     this->GetType() == cmState::MODULE_LIBRARY ||
+     this->IsExecutableWithExports())
+    {
+    if(const char* custom_export_name = this->GetProperty("DEFINE_SYMBOL"))
+      {
+      this->ExportMacro = custom_export_name;
+      }
+    else
+      {
+      std::string in = this->GetName();
+      in += "_EXPORTS";
+      this->ExportMacro = cmSystemTools::MakeCidentifier(in);
+      }
+    return this->ExportMacro.c_str();
+    }
+  else
+    {
+    return 0;
+    }
+}
+
+//----------------------------------------------------------------------------
 class cmTargetCollectLinkLanguages
 {
 public:
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 9533f43..b32bfd9 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -168,6 +168,10 @@ public:
 
   cmListFileBacktrace GetBacktrace() const;
 
+  /** Get the macro to define when building sources in this target.
+      If no macro should be defined null is returned.  */
+  const char* GetExportMacro() const;
+
   /** Get the soname of the target.  Allowed only for a shared library.  */
   std::string GetSOName(const std::string& config) const;
 
@@ -487,6 +491,8 @@ private:
   std::set<cmSourceFile const*> ExplicitObjectName;
   mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache;
 
+  mutable std::string ExportMacro;
+
   void ConstructSourceFileFlags() const;
   mutable bool SourceFileFlagsConstructed;
   mutable std::map<cmSourceFile const*, SourceFileFlags> SourceFlagsMap;
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 019cdd1..01e6f8c 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -297,7 +297,7 @@ std::string cmGhsMultiTargetGenerator::GetDefines(const std::string &language,
     std::set<std::string> defines;
     const char *lang = language.c_str();
     // Add the export symbol definition for shared library objects.
-    if (const char *exportMacro = this->Target->GetExportMacro())
+    if (const char *exportMacro = this->GeneratorTarget->GetExportMacro())
       {
       this->LocalGenerator->AppendDefines(defines, exportMacro);
       }
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index ea1b1a0..35f6a58 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1848,7 +1848,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     this->AppendDefines(ppDefs,
       "CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"");
     }
-  if(const char* exportMacro = target.GetExportMacro())
+  if(const char* exportMacro = gtgt->GetExportMacro())
     {
     // Add the export symbol definition for shared library objects.
     this->AppendDefines(ppDefs, exportMacro);
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index f40e6dd..a51eb67 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1543,7 +1543,7 @@ void cmLocalVisualStudio6Generator
 
   // Add the export symbol definition for shared library objects.
   std::string exportSymbol;
-  if(const char* exportMacro = target.GetExportMacro())
+  if(const char* exportMacro = gt->GetExportMacro())
     {
     exportSymbol = exportMacro;
     }
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 485ac31..819998c 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -777,7 +777,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.AddDefine(configDefine);
 
   // Add the export symbol definition for shared library objects.
-  if(const char* exportMacro = target.GetExportMacro())
+  if(const char* exportMacro = gt->GetExportMacro())
     {
     targetOptions.AddDefine(exportMacro);
     }
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f663678..58dea03 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2109,32 +2109,6 @@ std::string cmTarget::GetFrameworkVersion() const
     }
 }
 
-//----------------------------------------------------------------------------
-const char* cmTarget::GetExportMacro() const
-{
-  // Define the symbol for targets that export symbols.
-  if(this->GetType() == cmState::SHARED_LIBRARY ||
-     this->GetType() == cmState::MODULE_LIBRARY ||
-     this->IsExecutableWithExports())
-    {
-    if(const char* custom_export_name = this->GetProperty("DEFINE_SYMBOL"))
-      {
-      this->ExportMacro = custom_export_name;
-      }
-    else
-      {
-      std::string in = this->GetName();
-      in += "_EXPORTS";
-      this->ExportMacro = cmSystemTools::MakeCindentifier(in);
-      }
-    return this->ExportMacro.c_str();
-    }
-  else
-    {
-    return 0;
-    }
-}
-
 bool cmTarget::GetMappedConfig(std::string const& desired_config,
                                const char** loc,
                                const char** imp,
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 0e966e9..865bc8d 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -220,10 +220,6 @@ public:
                        const char** imp,
                        std::string& suffix) const;
 
-  /** Get the macro to define when building sources in this target.
-      If no macro should be defined null is returned.  */
-  const char* GetExportMacro() const;
-
   /** Return whether this target is an executable with symbol exports
       enabled.  */
   bool IsExecutableWithExports() const;
@@ -369,7 +365,6 @@ private:
   std::string Name;
   std::string InstallPath;
   std::string RuntimeInstallPath;
-  mutable std::string ExportMacro;
   std::vector<std::string> LinkDirectories;
   std::vector<cmCustomCommand> PreBuildCommands;
   std::vector<cmCustomCommand> PreLinkCommands;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 2cbd306..f4c632d 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1961,7 +1961,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
   configDefine += configName;
   configDefine += "\"";
   clOptions.AddDefine(configDefine);
-  if(const char* exportMacro = this->Target->GetExportMacro())
+  if(const char* exportMacro =
+          this->GeneratorTarget->GetExportMacro())
     {
     clOptions.AddDefine(exportMacro);
     }

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list