[cmake-developers] [PATCH] Drop if(...) check because condition is always true

Yury G. Kudryashov urkud.urkud at gmail.com
Sat Feb 25 04:20:57 EST 2012


From: "Yury G. Kudryashov" <urkud.urkud at gmail.com>

GetLocation returns std::string::c_str() which is never NULL
---
 Source/cmLocalGenerator.cxx |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ffbeb48..ea48dd1 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1903,12 +1903,8 @@ bool cmLocalGenerator::GetRealDependency(const char* inName,
       case cmTarget::MODULE_LIBRARY:
       case cmTarget::UNKNOWN_LIBRARY:
         {
-        // Get the location of the target's output file and depend on it.
-        if(const char* location = target->GetLocation(config))
-          {
-          dep = location;
-          return true;
-          }
+        dep = target->GetLocation(config);
+        return true;
         }
         break;
       case cmTarget::UTILITY:
-- 
1.7.8




More information about the cmake-developers mailing list