[cmake-developers] _check_cxx_compiler_attribute macro from GenerateExportHeader.cmake
Stephen Kelly
steveire at gmail.com
Tue Feb 21 18:02:41 EST 2012
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?
Thanks,
Steve.
More information about the cmake-developers
mailing list