[cmake-developers] _check_cxx_compiler_attribute macro from GenerateExportHeader.cmake

Rolf Eike Beer eike at sf-mail.de
Wed Feb 22 02:29:34 EST 2012


Stephen Kelly wrote:
> Rolf Eike Beer wrote:
> > This macro does this:
> > 
> > macro(_check_cxx_compiler_attribute _ATTRIBUTE _RESULT)
> > 
> >   check_cxx_source_compiles("${_ATTRIBUTE} int somefunc() { return 0; }
> >   
> >     int main() { return somefunc();}" ${_RESULT}
> >     # Some compilers do not fail with a bad flag
> >     FAIL_REGEX "unrecognized .*option"                     # GNU
> >     FAIL_REGEX "ignoring unknown option"                   # MSVC
> >     FAIL_REGEX "warning D9002"                             # MSVC, any
> >     lang
> >     FAIL_REGEX "[Uu]nknown option"                         # HP
> >     FAIL_REGEX "[Ww]arning: [Oo]ption"                     # SunPro
> >     FAIL_REGEX "command option .* is not recognized"       # XL
> >   
> >   )
> > 
> > endmacro()
> > 
> > The FAIL_REGEX were copied from CheckCXXCompilerFlag and are to match
> > errors about broken command line arguments. I doubt they make any sense at
> > this point. Is this intentional or by accident?
> 
> When you say 'not make any sense' what do you mean?

You don't want to check for errors coming from bad command line options here, 
do you? So why are there expressions there at all?

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20120222/3a0765b3/attachment.sig>


More information about the cmake-developers mailing list