[Cmake-commits] CMake branch, next, updated. v3.3.1-2262-ga420708

Brad King brad.king at kitware.com
Tue Aug 18 10:07:54 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  a420708f5280718f95507b6262b430d7594979bd (commit)
       via  49cdbc8e6bc079daa593e557a93a928dd01e7638 (commit)
      from  b2a7e6d6957d6def858382c1370feafac5371987 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a420708f5280718f95507b6262b430d7594979bd
commit a420708f5280718f95507b6262b430d7594979bd
Merge: b2a7e6d 49cdbc8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Aug 18 10:07:54 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Aug 18 10:07:54 2015 -0400

    Merge topic 'OUTPUT_NAME-genex-no-recursion' into next
    
    49cdbc8e Revert "cmGeneratorTarget: Avoid recursion in GetOutputName method"


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=49cdbc8e6bc079daa593e557a93a928dd01e7638
commit 49cdbc8e6bc079daa593e557a93a928dd01e7638
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Aug 18 10:07:16 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 18 10:07:21 2015 -0400

    Revert "cmGeneratorTarget: Avoid recursion in GetOutputName method"
    
    This reverts commit e66a7d6973fa58bb3bf37b540f67e2c33bb9fae2.
    We need a separate map for primary and implib output names.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 7d4bb67..299c112 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -270,70 +270,48 @@ const char *cmGeneratorTarget::GetProperty(const std::string& prop) const
 std::string cmGeneratorTarget::GetOutputName(const std::string& config,
                                              bool implib) const
 {
-  // Lookup/compute/cache the output name for this configuration.
-  cmGeneratorTarget::OutputNameMapType::iterator i =
-    this->OutputNameMap.find(config);
-  if(i == this->OutputNameMap.end())
+  std::vector<std::string> props;
+  std::string type = this->Target->GetOutputTargetType(implib);
+  std::string configUpper = cmSystemTools::UpperCase(config);
+  if(!type.empty() && !configUpper.empty())
     {
-    // Add empty name in map to detect potential recursion.
-    OutputNameMapType::value_type entry(config, "");
-    i = this->OutputNameMap.insert(entry).first;
-
-    // Compute output name.
-    std::vector<std::string> props;
-    std::string type = this->Target->GetOutputTargetType(implib);
-    std::string configUpper = cmSystemTools::UpperCase(config);
-    if(!type.empty() && !configUpper.empty())
-      {
-      // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG>
-      props.push_back(type + "_OUTPUT_NAME_" + configUpper);
-      }
-    if(!type.empty())
-      {
-      // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME
-      props.push_back(type + "_OUTPUT_NAME");
-      }
-    if(!configUpper.empty())
-      {
-      // OUTPUT_NAME_<CONFIG>
-      props.push_back("OUTPUT_NAME_" + configUpper);
-      // <CONFIG>_OUTPUT_NAME
-      props.push_back(configUpper + "_OUTPUT_NAME");
-      }
-    // OUTPUT_NAME
-    props.push_back("OUTPUT_NAME");
-
-    std::string outName;
-    for(std::vector<std::string>::const_iterator it = props.begin();
-        it != props.end(); ++it)
-      {
-      if (const char* outNameProp = this->Target->GetProperty(*it))
-        {
-        outName = outNameProp;
-        break;
-        }
-      }
+    // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG>
+    props.push_back(type + "_OUTPUT_NAME_" + configUpper);
+    }
+  if(!type.empty())
+    {
+    // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME
+    props.push_back(type + "_OUTPUT_NAME");
+    }
+  if(!configUpper.empty())
+    {
+    // OUTPUT_NAME_<CONFIG>
+    props.push_back("OUTPUT_NAME_" + configUpper);
+    // <CONFIG>_OUTPUT_NAME
+    props.push_back(configUpper + "_OUTPUT_NAME");
+    }
+  // OUTPUT_NAME
+  props.push_back("OUTPUT_NAME");
 
-    if(outName.empty())
+  std::string outName;
+  for(std::vector<std::string>::const_iterator i = props.begin();
+      i != props.end(); ++i)
+    {
+    if (const char* outNameProp = this->Target->GetProperty(*i))
       {
-      outName = this->GetName();
+      outName = outNameProp;
+      break;
       }
-
-    // Now evaluate genex and update the previously-prepared map entry.
-    cmGeneratorExpression ge;
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
-    i->second = cge->Evaluate(this->Makefile, config);
     }
-  else if(i->second.empty())
+
+  if (outName.empty())
     {
-    // An empty map entry indicates we have been called recursively
-    // from the above block.
-    this->Makefile->GetCMakeInstance()->IssueMessage(
-      cmake::FATAL_ERROR,
-      "Target '" + this->GetName() + "' OUTPUT_NAME depends on itself.",
-      this->Target->GetBacktrace());
+    outName = this->GetName();
     }
-  return i->second;
+
+  cmGeneratorExpression ge;
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
+  return cge->Evaluate(this->Makefile, config);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index a603975..68e7a8a 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -375,9 +375,6 @@ private:
   };
   mutable std::map<std::string, LinkImplClosure> LinkImplClosureMap;
 
-  typedef std::map<std::string, std::string> OutputNameMapType;
-  mutable OutputNameMapType OutputNameMap;
-
 public:
   std::vector<cmTarget const*> const&
     GetLinkImplementationClosure(const std::string& config) const;
diff --git a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-result.txt b/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-stderr.txt b/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-stderr.txt
deleted file mode 100644
index bf592e7..0000000
--- a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at OUTPUT_NAME-recursion.cmake:[0-9]+ \(add_executable\):
-  Target 'empty1' OUTPUT_NAME depends on itself.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion.cmake b/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion.cmake
deleted file mode 100644
index 5cb8050..0000000
--- a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-enable_language(C)
-add_executable(empty1 empty.c)
-set_property(TARGET empty1 PROPERTY OUTPUT_NAME $<TARGET_FILE_NAME:empty1>)
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 0679024..21fc851 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -26,7 +26,6 @@ run_cmake(COMPILE_LANGUAGE-add_library)
 run_cmake(COMPILE_LANGUAGE-add_test)
 run_cmake(COMPILE_LANGUAGE-unknown-lang)
 run_cmake(TARGET_FILE-recursion)
-run_cmake(OUTPUT_NAME-recursion)
 
 run_cmake(ImportedTarget-TARGET_PDB_FILE)
 if(LINKER_SUPPORTS_PDB)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion.cmake
index e780103..7633be1 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion.cmake
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion.cmake
@@ -1,4 +1,3 @@
 enable_language(C)
 add_executable(empty1 empty.c)
-set_property(TARGET empty1 PROPERTY OUTPUT_NAME $<TARGET_FILE_NAME:empty1>)
 set_property(TARGET empty1 PROPERTY RUNTIME_OUTPUT_DIRECTORY $<TARGET_FILE_DIR:empty1>)

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

Summary of changes:
 Source/cmGeneratorTarget.cxx                       |   92 ++++++++------------
 Source/cmGeneratorTarget.h                         |    3 -
 .../OUTPUT_NAME-recursion-result.txt               |    1 -
 .../OUTPUT_NAME-recursion-stderr.txt               |    4 -
 .../OUTPUT_NAME-recursion.cmake                    |    3 -
 .../GeneratorExpression/RunCMakeTest.cmake         |    1 -
 .../TARGET_FILE-recursion.cmake                    |    1 -
 7 files changed, 35 insertions(+), 70 deletions(-)
 delete mode 100644 Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-result.txt
 delete mode 100644 Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-stderr.txt
 delete mode 100644 Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list