Hi Eric,<br><br><br>1) Your first option wouldn't work because "CMAKE_REQUIRED_FLAGS" isn't known by neither try_compile, neither the macro.<br><br>2) Wouldn't work either because try_compile doesn't take command line parameters (at least not in this form & unless you will construct the makefile from hand inside this script).<br>
<br>3) I think this is the only feasible way in fact... Although I find this the least nicest way, and as such I didn't try that one.<br><br><br>Grtz,<br>Steven<br><br><div class="gmail_quote">2009/7/8 Eric Noulard <span dir="ltr"><<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2009/7/8 Steven Van Ingelgem <<a href="mailto:steven@vaningelgem.be">steven@vaningelgem.be</a>>:<br>
<div><div></div><div class="h5">> Hi,<br>
><br>
><br>
> I tried this call:<br>
> CHECK_FUNCTION_EXISTS(snprintf HAS_snprintf)<br>
><br>
><br>
> Which results in this error being generated:<br>
> C:\MinGW\bin\gcc.exe -g -ggdb -O0 -Wall -Werror<br>
> -DCHECK_FUNCTION_EXISTS=snprintf -o<br>
> CMakeFiles\cmTryCompileExec.dir\CheckFunctionExists.c.obj -c "C:\Program<br>
> Files\CMake 2.7\share\cmake-2.7\Modules\CheckFunctionExists.c"<br>
> cc1.exe: warnings being treated as errors<br>
> C:\Program Files\CMake 2.7\share\cmake-2.7\Modules\CheckFunctionExists.c:3:<br>
> error: conflicting types for built-in function 'snprintf'<br>
><br>
><br>
> What I understand is that the snprintf type exists, but conflicts with the<br>
> built-in version... So this should return 'true' in fact...<br>
><br>
> What can I do about it?<br>
<br>
</div></div>Disable builtin support with<br>
SET(CMAKE_REQUIRED_FLAGS "-fno-builtin")<br>
see: <a href="http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/C-Dialect-Options.html#C-Dialect-Options" target="_blank">http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/C-Dialect-Options.html#C-Dialect-Options</a><br>
<br>
or<br>
<br>
update CheckFunctionExists.cmake in order to make it try builtin first?<br>
<br>
or<br>
<br>
update CheckFunctionExists.cmake in order to make it catch the<br>
<div class="im">"conflicting types for built-in function"<br>
</div>and return true in this case?<br>
<font color="#888888"><br>
<br>
--<br>
Erk<br>
Membre de l'April - « promouvoir et défendre le logiciel libre » -<br>
<a href="http://www.april.org" target="_blank">http://www.april.org</a><br>
</font></blockquote></div><br>