瀏覽代碼

Port cmGeneratorExpression to cmTarget from cmGeneratorTarget.

Following from the discussion here:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/3615/focus=5170
 (Re: Generator expressisons in target properties, 26 Oct 12:10)

we can't split cmTarget API for linking into cmGeneratorTarget. In
the future we will probably also need to move the include and compile
definitions API back to cmTarget so that it can be used by export().
Stephen Kelly 13 年之前
父節點
當前提交
d8a59ea4b3

+ 1 - 1
Source/cmGeneratorExpression.cxx

@@ -68,7 +68,7 @@ cmGeneratorExpression::~cmGeneratorExpression()
 //----------------------------------------------------------------------------
 const char *cmCompiledGeneratorExpression::Evaluate(
   cmMakefile* mf, const char* config, bool quiet,
-  cmGeneratorTarget *target,
+  cmTarget *target,
   cmGeneratorExpressionDAGChecker *dagChecker) const
 {
   if (!this->NeedsParsing)

+ 1 - 2
Source/cmGeneratorExpression.h

@@ -20,7 +20,6 @@
 #include <cmsys/RegularExpression.hxx>
 
 class cmTarget;
-class cmGeneratorTarget;
 class cmMakefile;
 class cmListFileBacktrace;
 
@@ -68,7 +67,7 @@ class cmCompiledGeneratorExpression
 public:
   const char* Evaluate(cmMakefile* mf, const char* config,
                        bool quiet = false,
-                       cmGeneratorTarget *target = 0,
+                       cmTarget *target = 0,
                        cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
 
   /** Get set of targets found during evaluations.  */

+ 2 - 2
Source/cmGeneratorExpressionEvaluator.cxx

@@ -287,7 +287,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
     cmsys::RegularExpression propertyNameValidator;
     propertyNameValidator.compile("^[A-Za-z0-9_]+$");
 
-    cmGeneratorTarget* target = context->Target;
+    cmTarget* target = context->Target;
     std::string propertyName = *parameters.begin();
     if (parameters.size() == 2)
       {
@@ -320,7 +320,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
                       "Target name not supported.");
         return std::string();
         }
-      target = context->Makefile->FindGeneratorTargetToUse(
+      target = context->Makefile->FindTargetToUse(
                                                 targetName.c_str());
 
       if (!target)

+ 1 - 2
Source/cmGeneratorExpressionEvaluator.h

@@ -18,7 +18,6 @@
 #include "cmListFileCache.h"
 
 class cmTarget;
-class cmGeneratorTarget;
 
 //----------------------------------------------------------------------------
 struct cmGeneratorExpressionContext
@@ -27,7 +26,7 @@ struct cmGeneratorExpressionContext
   std::set<cmTarget*> Targets;
   cmMakefile *Makefile;
   const char *Config;
-  cmGeneratorTarget *Target;
+  cmTarget *Target;
   bool Quiet;
   bool HadError;
 };

+ 2 - 2
Source/cmGeneratorTarget.cxx

@@ -308,7 +308,7 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
                                     .Evaluate(this->Makefile,
                                               config,
                                               false,
-                                              this,
+                                              this->Target,
                                               &dagChecker),
                                     includes);
 
@@ -356,6 +356,6 @@ std::string cmGeneratorTarget::GetCompileDefinitions(const char *config)
   return ge.Parse(prop).Evaluate(this->Makefile,
                                  config,
                                  false,
-                                 this,
+                                 this->Target,
                                  &dagChecker);
 }