[cmake-developers] _check_cxx_compiler_attribute macro from GenerateExportHeader.cmake

Rolf Eike Beer eike at sf-mail.de
Tue Feb 21 17:21:06 EST 2012


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?

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/20120221/2472fb2f/attachment.sig>


More information about the cmake-developers mailing list