Allow host to be passed to CMake for cross compile
When cross compiling for Android on Windows, GetHostTriple.cmake will end up running Linux shell commands. This small change lets the user pass in LLVM_INFERRED_HOST_TRIPLE via the cmake command line and bypass the need to invoke the GetHostTriple logic.
With this change I was able to build for Android on Windows using the ninja generator and passing -DLLVM_INFERRED_HOST_TRIPLE=x86_64-pc-win32 to cmake.
:white_check_mark: Build DirectXShaderCompiler 1.0.434 completed (commit https://github.com/microsoft/DirectXShaderCompiler/commit/5e3c4dcafd by @)
Upstream LLVM resolved this issue with the following commit:
https://github.com/llvm/llvm-project/commit/2874d285b9f35af8ca6c0268d3aadea4fe671c68
Might be worth just cherry-picking that back instead of diverging.
Hi, i also try to cross compile dxc for android on windows with cmake, and change GetHostTriple.cmake. But it still doesn't work. i get the error below.
CMake Error at C:/Program Files/CMake/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find D3D12 (missing: D3D12_INCLUDE_DIRS D3D12_LIBRARIES)
If i just compile for windows, there is no problem. i find that llvm try to make a new build named NATIVE in cross-compiling enviornment. And cmake fails to configure the NATIVE.