[PATCH] [libc++] Add support for cross compiling libc++.
danalbert at google.com
Wed Jan 14 18:20:37 PST 2015
Comment at: CMakeLists.txt:85
@@ +84,3 @@
+ option(LIBCXX_SYSROOT "Sysroot for cross compiling.")
We can't use `CMAKE_CROSSCOMPILING` for this because AFAICT cmake (prior to 3.x) will only set that if you are compiling to a different system (i.e. Linux to Windows), but not to a different architecture. Since the variable can't be overridden, we just introduce our own.
libc++abi will need a similar one, so perhaps it should just be `LLVM_CROSSCOMPILING`? Do we already have such a thing? I need to take another look through how LLVM handles this.
Another option would just be removing it entirely. I suppose setting a sysroot/toolchain is probably helpful for non-cross compiles as well, and the only other thing this guards is the passing of `LIBCXX_TARGET_TRIPLE` to `lit.site.cfg` and its subsequent use in `lit.cfg`.
More information about the cfe-commits