<div dir="ltr"><font face="arial, helvetica, sans-serif">There are two big issues with the check_function_exists() module that I've run into, and that others have also encountered:</font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51)"><font face="arial, helvetica, sans-serif">(1) It can't detect functions that are inlined in system headers or specified as a #define macro. (see <span style="color:rgb(17,85,204);text-decoration:underline"><a href="https://cmake.org/pipermail/cmake-developers/2015-July/025766.html">https://cmake.org/pipermail/cmake-developers/2015-July/025766.html</a>)</span></font></p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51)"><font face="arial, helvetica, sans-serif">(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 <a href="https://cmake.org/pipermail/cmake/2008-April/021099.html">https://cmake.org/pipermail/cmake/2008-April/021099.html</a>)</font></p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol"">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).</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol"">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.<br></p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol""><br></p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol"">Thanks!</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol"">Stephen Sorley</p></div></div>