[cmake-developers] What about #line like feature in cmake language?

Nicolas Desprès nicolas.despres at gmail.com
Wed May 21 15:24:52 EDT 2014


On Wed, May 21, 2014 at 8:06 PM, Matthew Woehlke <
mw_triad at users.sourceforge.net> wrote:

> On 2014-05-15 08:36, Ben Boeckel wrote:
> > On Thu, May 15, 2014 at 12:45:27 +0200, Nicolas Desprès wrote:
> >> Nope. These variables are the cmake equivalent to the __LINE__ and
> __FILE__
> >> C-pre-processor macro. What I need is the #line directive equivalent
> which
> >> force the value of these variables so that error messages reported by
> cmake
> >> uses the forced value.
> >
> > If you'd like to try a patch, the relevant code is in
> > Source/cmExprParser*. Add a callback for #line nnn and update the
> > CurrentLine variable cmExprParserHelper.cxx. Don't forget tests :) .
> >
> > This will also likely need a policy since there's no guarantee that
> > #line "directives" don't exist in already existing code as comments.
>
> Maybe we should not introduce pragma-like constructs that are
> indistinguishable from comments? :-)
>
> TBH I'd be a little ambivalent about such a feature. A line pragma
> itself isn't too bad, but opening the door for other types of pragmas
> makes me a little more nervous :-).
>
> If it is possible I would rather prefer a cmake macro too.

-- 
Nicolas Desprès
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140521/b474bde1/attachment-0002.html>


More information about the cmake-developers mailing list