DEFAULT_SYSROOT variable not used by the cmake

I am trying to build a clang-13 cross-compiler for RISCV using riscv-gnu-toolchain. Following is the cmake command I am using:

cmake -G Ninja -DCMAKE_BUILD_TYPE="Debug" \
  -DCMAKE_INSTALL_PREFIX="../../_install" \
  -DDEFAULT_SYSROOT="/mnt/efs/home/aahmad/riscv/_install/sysroot/" \
  -DLLVM_DEFAULT_TARGET_TRIPLE="riscv64-unknown-linux-gnu" \

But when I run this command I get the following warning:

CMake Warning:
  Manually-specified variables were not used by the project:


Please guide me on how can I get rid of this warning.

DEFAULT_SYSROOT appears to be used when cross compiling llvm. For example clang/cmake/caches/CrossWinToARMLinux.cmake uses it to compile from Windows, to Arm Linux.

I think you’re building clang to run on RISCV, so the option could be relevant. However I think the riscv-gnu toolchain will set up the sysroot for you regardless. I would guess that you can remove DEFAULT_SYSROOT and be fine.

FWIW I propose that we deprecated and remove DEFAULT_SYSROOT: ⚙ D158218 [CMake] Deprecate DEFAULT_SYSROOT and GCC_INSTALL_PREFIX