[CMake] Adding cross-compiler support to CMake ...

Sean McBride sean at rogue-research.com
Mon Sep 11 12:49:35 EDT 2006


On 2006-09-08 14:40, Brandon J. Van Every said:

>Benjamin Reed wrote:
>> On 9/6/06, Brandon J. Van Every <bvanevery at gmail.com> wrote:
>>
>>> Actually it's not invalid to compile it.  That's what a cross-compiler
>>> does.  It's invalid to run it.  CMake already has this distinction
>>> between TRY_COMPILE and TRY_RUN, so if TRY_RUN is used inappropriately,
>>> that's user error.  If CMake knows it's in some kind of
>>> cross-compilation mode, it can disallow TRY_RUN and deliver an error.
>>
>> I don't know if this is what he meant, but at least as far as
>> universal binaries are concerned, TRY_COMPILE *can* cause issues.
>>
>> For example, there are a number of autotool'd things that I have built
>> as universal binaries which fail to build out of the box because they
>> do:
>>
>> * checking endianness... big endian
>
>But that is a form of TRY_RUN.

CMake's CMakeLists.txt has no TRY_RUN's and only one TRY_COMPILE.  Yet,
when I build cmake with cmake I see the "checking endianness" message.

So now I've more confused.  What is doing that check?  And surely that
check is broken wrt cross compilation, as you say here:

>You can't check endianness just by 
>compiling something, you have to get a result back from running the 
>program.  At least, I'm not thinking of any snippet of code that's 
>portable, can be compiled on a little endian architecture, and not a big 
>endian one.

Agreed.

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the CMake mailing list