2009/7/8 Hendrik Sattler <p...@hendrik-sattler.de>:
> Zitat von Eric Noulard <eric.noul...@gmail.com>:
>>
>> It works for me and the CMakeFiles/CMakeOutput.log reads:
>>
>> Building C object CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o
>> /usr/bin/gcc  -DWHAT=ever -DCHECK_FUNCTION_EXISTS=snprintf
>> -fno-builtin   -o
>> CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o   -c
>> /home/eric/CMake/cmake-V2_6/share/cmake-2.6/Modules/CheckFunctionExists.c
>>
>> which is the expect command line.
>
> It's not. The OP use additional -W parameters like -Werror.
> Actually, the test should be made work with -Wall -Wextra -Werror.

Ok right that's because I forget to add those flags in my "too-simple"
test case,
the fact is if you add:

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror")

 before

SET(CMAKE_REQUIRED_FLAGS "-fno-builtin")


Then you get in the log:

Building C object CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o
/usr/bin/gcc   -Wall -Wextra -Werror  -DCHECK_FUNCTION_EXISTS=snprintf
-fno-builtin   -o
CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o   -c
/home/eric/CMake/cmake-V2_6/share/cmake-2.6/Modules/CheckFunctionExists.c

which **should** be the expected command line :-)

not to mentionned that the "snprintf" is FOUND with the extra
SET(CMAKE_REQUIRED_FLAGS "-fno-builtin")

and is "not found" without it.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to