DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

Allow host to be passed to CMake for cross compile

Open pdodzweit opened this issue 4 years ago • 2 comments

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.

pdodzweit avatar Aug 25 '21 22:08 pdodzweit

:white_check_mark: Build DirectXShaderCompiler 1.0.434 completed (commit https://github.com/microsoft/DirectXShaderCompiler/commit/5e3c4dcafd by @)

AppVeyorBot avatar Aug 26 '21 00:08 AppVeyorBot

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.

llvm-beanz avatar Aug 28 '21 23:08 llvm-beanz

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.

shihaoli888 avatar Oct 25 '22 12:10 shihaoli888