Sean McBride wrote:
Remember that using TRY_COMPILE/TRY_RUN or any method that runs code on
the build machine breaks cross-compilation.
(...)
Since a compiler knows what CPU it is compiling for (by definition), I
think a better solution, in general, is to query the compiler.
See Boost's
I have recently joined a project where I am to do some coding. The
code base is cross platform HPC type code and the original coders
have defined their own little/big endian #defines (L_ENDIAN
B_ENDIAN). They pass this into the compiler via -DL_ENDIAN during
compiles.
Is there a way to
May be you could use TRY_RUN to detect endianity
with something like:
TRY_RUN(
ENDIANESS_RESULT
ENDIANESS_COMPILE
/tmp/
${CMAKE_CURRENT_SOURCE_DIR}/make/endianess.c
OUTPUT_VARIABLE ENDIANESS_OUT
)
MESSAGE(STATUS ENDIANITY is :${ENDIANESS_OUT})
endianess.c is attached.
The trouble I
Eric Noulard wrote:
May be you could use TRY_RUN to detect endianity
with something like:
TRY_RUN(
ENDIANESS_RESULT
ENDIANESS_COMPILE
/tmp/
${CMAKE_CURRENT_SOURCE_DIR}/make/endianess.c
OUTPUT_VARIABLE ENDIANESS_OUT
)
MESSAGE(STATUS ENDIANITY is :${ENDIANESS_OUT})
endianess.c is
On 2006-11-22 19:00, Eric Noulard said:
Sorry for my dummy answer:
1) There is a TestBigEndian.cmake already shipped with CMake (as of 2.4.3)
2) I should have checked ENDIANESS_RESULT and not
ENDIANESS_OUT
At the risk of repeating myself... :)
Remember that using TRY_COMPILE/TRY_RUN or any
Sean McBride wrote:
On 2006-11-22 19:00, Eric Noulard said:
Sorry for my dummy answer:
1) There is a TestBigEndian.cmake already shipped with CMake (as of 2.4.3)
2) I should have checked ENDIANESS_RESULT and not
ENDIANESS_OUT
At the risk of repeating myself... :)
Remember that