[Patch] Improvements for CMake cross compilation on OS X

Brad King brad.king at kitware.com
Tue Sep 2 06:35:11 PDT 2014

On 8/28/2014 4:22 PM, Chandler Carruth wrote:
> Adding folks with specific knowledge of the compiler-rt and cmake and
> the trickiness there...
> On Thu, Aug 28, 2014 at 1:13 PM, Chris Bieneman wrote:
>     The attached patch modifies how cross compiling is handled with
>     CMake to make it possible to cross compile LLVM and Clang using a
>     single CMake invocation. This patch works for LLVM & Clang with no
>     additional patches required. It does not work for compiler-rt
>     because of how compiler-rt's CMake configuration is implemented.

Thanks for working on this.  I've glanced through the patch and
it looks correct for the approach intended.  I'm not set up to
apply and test the patch with an iOS toolchain so I cannot confirm
that it works.

> ...

FYI, these custom commands may be better written with the form

 cmake --build . --target ${target} --config $<CONFIGURATION>

in order to work across all CMake generators (note that the
$<CONFIGURATION> is literal: it is a generator expression).

Another completely different approach is to use the ExternalProject
module to create a "superbuild" from a tiny source tree that does
nothing but use ExternalProject_Add to configure the host and target
builds separately and in order.


More information about the llvm-commits mailing list