Regarding the warning "LLVM_CONFIG_PATH is deprecated, please use LLVM_CMAKE_DIR instead"

Hi,

We are developing an LLVM based toolchain for Arm (GitHub - ARM-software/LLVM-embedded-toolchain-for-Arm: A project dedicated to building LLVM toolchain for 32-bit Arm embedded targets.) and during the compiler-rt build stage we are seeing the following warning.

CMake Warning at cmake/Modules/CompilerRTUtils.cmake:281 (message):
  LLVM_CONFIG_PATH is deprecated, please use LLVM_CMAKE_DIR instead
Call Stack (most recent call first):
  CMakeLists.txt:87 (load_llvm_config)

However looking at the documentation, Building LLVM with CMake — LLVM 17.0.0git documentation, it seems as if LLVM_CMAKE_DIR is not something the user directly sets, but rather a variable set by LLVMConfig.cmake which is pointed to by LLVM_DIR.
Is my understanding correct, and does the block in llvm-project/CompilerRTUtils.cmake at main · llvm/llvm-project · GitHub need correcting?

The warning was introduced here:
https://reviews.llvm.org/D137024

Thanks @tschuett.
@mgorny considering that you introduced the warning, I would like to know your opinion on this.

I’m afraid I don’t really know the answer. It was a long time ago, and my focus was specifically on eliminating llvm-config use.

The message refers to LLVM_CMAKE_DIR because that’s what the code uses. I don’t know what is the preferred of setting it these days.

1 Like

Thanks for your reply @mgorny.