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  f8d61cbe5066a6d8ce3e09afc40cdf1ea0e73631 (commit)
       via  35aab9df9f299d62edaa6ce611aa30614deb9e9d (commit)
      from  e48c57b81341ee14e0ac61f683224b1dd7b544f0 (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=f8d61cbe5066a6d8ce3e09afc40cdf1ea0e73631
commit f8d61cbe5066a6d8ce3e09afc40cdf1ea0e73631
Merge: e48c57b 35aab9d
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Aug 6 11:07:25 2015 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Thu Aug 6 11:07:25 2015 -0400

    Merge topic 'fix-TARGET_FILE-imported' into next
    
    35aab9df Reject TARGET_PDB_FILE for imported targets instead of crashing


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=35aab9df9f299d62edaa6ce611aa30614deb9e9d
commit 35aab9df9f299d62edaa6ce611aa30614deb9e9d
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Aug 3 15:28:41 2015 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Aug 6 09:42:31 2015 -0400

    Reject TARGET_PDB_FILE for imported targets instead of crashing
    
    Reported-by: Justin Borodinsky <justin.borodin...@gmail.com>

diff --git a/Source/cmGeneratorExpressionNode.cxx 
b/Source/cmGeneratorExpressionNode.cxx
index a86c2bc..44a9adb 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1600,6 +1600,13 @@ struct 
TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
                             cmGeneratorExpressionContext *context,
                             const GeneratorExpressionContent *content)
   {
+    if (target->IsImported())
+      {
+      ::reportError(context, content->GetOriginalExpression(),
+                    "TARGET_PDB_FILE not allowed for IMPORTED targets.");
+      return std::string();
+      }
+
     std::string language = target->GetLinkerLanguage(context->Config);
 
     std::string pdbSupportVar = "CMAKE_" + language + "_LINKER_SUPPORTS_PDB";
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index c831704..e490368 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1248,6 +1248,7 @@ void cmGeneratorTarget::ComputeLinkClosure(const 
std::string& config,
   UNORDERED_SET<std::string> languages;
   cmTarget::LinkImplementation const* impl =
                             this->Target->GetLinkImplementation(config);
+  assert(impl);
   for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
       li != impl->Languages.end(); ++li)
     {
diff --git 
a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-result.txt 
b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ 
b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-result.txt
@@ -0,0 +1 @@
+1
diff --git 
a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-stderr.txt 
b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-stderr.txt
new file mode 100644
index 0000000..d915ecb
--- /dev/null
+++ 
b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at ImportedTarget-TARGET_PDB_FILE.cmake:2 \(add_custom_target\):
+  Error evaluating generator expression:
+
+    \$<TARGET_PDB_FILE:empty>
+
+  TARGET_PDB_FILE not allowed for IMPORTED targets.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git 
a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE.cmake 
b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE.cmake
new file mode 100644
index 0000000..c55c5d5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE.cmake
@@ -0,0 +1,2 @@
+add_library(empty UNKNOWN IMPORTED)
+add_custom_target(custom COMMAND echo $<TARGET_PDB_FILE:empty>)
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake 
b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 1c8fab5..cba3941 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -26,6 +26,7 @@ run_cmake(COMPILE_LANGUAGE-add_library)
 run_cmake(COMPILE_LANGUAGE-add_test)
 run_cmake(COMPILE_LANGUAGE-unknown-lang)
 
+run_cmake(ImportedTarget-TARGET_PDB_FILE)
 if(LINKER_SUPPORTS_PDB)
   run_cmake(NonValidTarget-TARGET_PDB_FILE)
   run_cmake(ValidTarget-TARGET_PDB_FILE)

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

Summary of changes:
 Source/cmGeneratorExpressionNode.cxx                            |    7 +++++++
 Source/cmGeneratorTarget.cxx                                    |    1 +
 .../ImportedTarget-TARGET_PDB_FILE-result.txt}                  |    0
 ...ILE-stderr.txt => ImportedTarget-TARGET_PDB_FILE-stderr.txt} |    4 ++--
 .../GeneratorExpression/ImportedTarget-TARGET_PDB_FILE.cmake    |    2 ++
 Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake           |    1 +
 6 files changed, 13 insertions(+), 2 deletions(-)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-result.txt} (100%)
 copy 
Tests/RunCMake/GeneratorExpression/{NonValidCompiler-TARGET_PDB_FILE-stderr.txt 
=> ImportedTarget-TARGET_PDB_FILE-stderr.txt} (52%)
 create mode 100644 
Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE.cmake


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to