[cmake-developers] [PATCH v5 0/4] Add continue keyword
Brad King
brad.king at kitware.com
Tue Nov 25 14:49:15 EST 2014
On 11/18/2014 10:34 AM, Gregor Jasny wrote:
> Changes compared to v4:
> * Use new style error reporting in cmContinueCommand.cxx
> * Reject any given arguments to continue()
> * CMP0055: Reject any arguments to break, too.
>
> I put both checks: the loop block check and the empty arguments
> check into the same policy. Please drop me a note if you want to
> have an extra policy per check.
Looks good. I factored out the 'RunCMake.return' test into
its own commit:
return: Add test for returning inside a foreach loop
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d124c411
Then I reordered the changes to add the break() policy first:
Track nested loop levels in CMake language with a stack of counters
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bae604d9
break: Add policy CMP0055 to check calls strictly
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d54617d0
I took the liberty to preserve your sign-off lines even though
they are no longer exactly what you sent. Let me know if I
should drop them or if you still sign off the new commits.
The remaining changes are in the attached patch. It applies
based on the above-linked commit d54617d0. Please revise it
to add more context to the -stderr.txt files in the expected
test output. See the hunk below as an example. All the other
RunCMake tests that check errors like this have context too.
Thanks,
-Brad
$ git diff |cat
diff --git a/Tests/RunCMake/continue/NoArgumentsToContinue-stderr.txt b/Tests/RunCMake/continue/NoArgumentsToContinue-stderr.txt
index d968a62..66be462 100644
--- a/Tests/RunCMake/continue/NoArgumentsToContinue-stderr.txt
+++ b/Tests/RunCMake/continue/NoArgumentsToContinue-stderr.txt
@@ -1 +1,4 @@
+CMake Error at NoArgumentsToContinue.cmake:2 \(continue\):
The CONTINUE command does not accept any arguments.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-continue-Add-a-new-CMake-language-command-for-loop-c.patch
Type: text/x-diff
Size: 19023 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20141125/cd7650be/attachment-0001.patch>
More information about the cmake-developers
mailing list