Details
Diff Detail
Event Timeline
CMakeLists.txt | ||
---|---|---|
87 | 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. |
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.
LLVM_CROSSCOMPILING and LIBCXX{ABI}_CROSSCOMPILING should be fundamentally different things. The former would only apply when host!=build, whereas the latter, because libcxx{abi} is a runtime component, applies when host!=target.
Another option would just be removing it entirely. I suppose setting a sysroot/toolchain is probably helpful for non-cross compiles as well
Yeah, there are valid use cases for this outside of cross compiles. I'd get rid of the guard.
It's awesome how terribly simple this is.
test/CMakeLists.txt | ||
---|---|---|
26 ↗ | (On Diff #18206) | I think this might belong in a separate patch. |
Remove LIBCXX_CROSSCOMPILING. The options it was guarding are useful outside a
cross compiling situation.
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.