On 06/06/2013 10:37 AM, Christopher Sean Morrison wrote:
>> $ cat symbol_main.c
>> #include <stdio.h> /* declares tested symbol */
>> extern int cmakeRequireSymbol(int, ...);
>> int main(int argc, const char* argv[]) { return cmakeRequireSymbol(argc, 
>> &printf); }
>>
>> $ cat symbol_impl.c
>> int cmakeRequireSymbol(int x, ...) { return x; }
> 
> This sounds looks like the best option to me, better than
> casting through an integer.
> 
> Want me to work up a patch or is someone already on it?

It will be simpler if we first extend the try_compile command
to support multiple source files in the "source file" signature
so we do not need to construct a full source tree and write the
CMakeLists.txt by hand for the check.

Recently in master I merged some refactoring of the try_compile
command argument processing so it should now be straightforward
to add more options.  Currently the signatures are

 try_compile(RESULT_VAR <bindir> <srcdir> <projectName> ...) #dir
 try_compile(RESULT_VAR <bindir> <srcfile> ...) #file

Perhaps we should add

 try_compile(RESULT_VAR <bindir> SOURCES <src>... ...)

Would you be able to try all that?

Thanks,
-Brad
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to