[cmake-developers] deprecate check_function_exists?

Stephen Sorley stephen.sorley at gmail.com
Wed Jan 11 15:59:18 EST 2017


There are two big issues with the check_function_exists() module that I've
run into, and that others have also encountered:

(1) It can't detect functions that are inlined in system headers or
specified as a #define macro. (see
https://cmake.org/pipermail/cmake-developers/2015-July/025766.html)

(2) For 32-bit Windows builds, it can't link against functions declared
with a different calling convention than __cdecl. Since the Win32 API uses
__stdcall, check_function_exists can't detect anything from libraries like
kernel.lib or ws2_32.lib. (see
https://cmake.org/pipermail/cmake/2008-April/021099.html)

The check_symbol_exists() module solves both of the above problems, and it
does verify that the function is available at link time (if the symbol
isn't a #define).

So, could check_function_exists() be explicitly deprecated in the
documentation in favor of check_symbol_exists()?  I think most users find
it natural to try using check_function_exists() first because of the name,
when they really should be using check_symbol_exists() for all of the use
cases I can think of.


Thanks!

Stephen Sorley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20170111/29da4728/attachment.html>


More information about the cmake-developers mailing list