Hi Brad,

For context, I'm the maintainer of yotta (github: ARMmbed/yotta), a
module system primarily for cross-compiled embedded software, which
uses CMake for the build.

> Basically CMake now needs to detect a lot more from the compiler than
> we can expect a caller to provide in a CMAKE_FORCE_C_COMPILER call.
> We need to make the compiler detection work for everyone.

I'm worried that built-in compiler detection might not be possible across
the variety of cross-compilers used. In some cases, for example, the
existence of a particular compiler, or a modified version of it, might be
a secret outside of the company using it.

> For linking the actual binaries during your build you must have some
> linker scripts.  Perhaps we should provide a way for the toolchain
> file to specify a linker script to use for try_compile checks.  That
> would then be used during the check for a working compiler, ABI check,
> and later try_compile checks to allow them to work as normal but still
> represent the real target platform.  Might that work for this use case?

This could work, but it may be necessary to specify arbitrary flags, and
the format of the link command not just a link script to get a link step to
succeed.

Since the link script that people are actually using to build their program
might contain assertions about the things being linked, or reference
symbols which need to have been defined, it would need to be possible
to use a different link script at this point than in the actual
CMAKE_<LANG>_LINK_X commands.

Using a dummy link command to check that linking works seems to
undermine the purpose of checking in the first place, which suggests
that perhaps it should still be possible to skip the check?

Best regards,
James





IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to