When cross compiling the testsuite we still need to compile timeit/fpcmp
for the host machine. These two files are extremely simple C files so adding a custom
command that just runs "cc timeit.c -o timeit" should do the trick.
Details
Diff Detail
Event Timeline
Since these are really simple source files, it is probably better to check CMAKE_CROSSCOMPILING and when cross-compiling use ExternalProject to configure host versions of the tools.
Looks like my cmake-foo is not strong enough for ExternalProject_Add.
For one CMAKE_CROSSCOMPILING is not set for me even though I am happily crosscompiling to aarch64 by just passing the respective -arch arm64 CFLAGS. Apart from that AddExternalProject_Add has a LOT of options and I am not really sure which ones I need or what to set them to. Are you sure this is better/simpler than two simple custom commands?
CMAKE_CROSSCOMPILING is set by CMake when you explicitly set CMAKE_SYSTEM_NAME. Instead of setting the -arch flag, try setting CMAKE_TOOLCHAIN_FILE to point to the ios.cmake file in LLVM trunk, and set CMAKE_OSX_ARCHITECTURES to arm64.
There is an example of cross compiling LLVM here: http://llvm.org/docs/GettingStarted.html#cross-compiling-llvm