Failed to build the project with cmake, llvm-build: error: invalid target to enable: 'AMDGPU' (not in project)

OS: Windows 11 GPU: AMD 6600xt Driver: AMD Software: Adrenalin Edition 22.51
to reproduce:
mkdir build
cd build
cmake ..
No, just "cmake .." doesn't work. You need to set parameters to it. Check cmake\caches\PredefinedParams.cmake for details.
Thanks @gongminmin!
Can someone please elaborate on what to do to fix this? In https://github.com/alaingalvan/CrossShader this project is added as CMake dependency in CMakeLists like this: add_subdirectory(external/directxshadercompiler)
And I get the same compilation error when trying to compile to wasm. What can be done about this?
I'd also really appreciate an elaboration on this, I'm stuck.
Stumbled over this as well: in vulkan's DirectXShaderCompiler it helps to pass the path to the mentioned PredefinedParams.cmake
like cmake -DDXC_USE_LIT=On -C ../cmake/caches/PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS="-v" ..
i copied this from source/DirectXShaderCompiler/CMakeSettings.json
I don't really understand why/how DirectXShaderCompiler has this strange extra requirement or why the fix work,s but the above fix does also work for me - many thanks!
I solved this problem directly in the CMakeLists .txt include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/caches/PredefinedParams.cmake).
I solved this problem directly in the CMakeLists .txt include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/caches/PredefinedParams.cmake).
2026 this problem still exists, Thansk to keyi4541 this problem could be solved this way!