clang currently uses llvm-config to determine the installation paths
for llvm's headers and binaries. clang is also using LLVM's cmake
files to determine other information about the LLVM build, like
LLVM_LIBDIR_SUFFIX, LLVM_VERSION_*, etc. Since the installation
paths are also available via the cmake files, we can simplify the code
by only relying on information from cmake about the LLVM install and
dropping the use of llvm-config altogether.
In addition to simplifying the code, the cmake files have more
accurate information about the llvm installation paths. llvm-config
assumes that the lib, bin, and cmake directories are always located
in the same place relative to the path of the llvm-config executable.
This can be wrong if a user decides to install headers, binaries
or libraries to a non-standard location: e.g. static libraries
installed to /usr/lib/llvm6.0/
This patch takes the first step towards dropping llvm-config by
removing the automatic detection of llvm-config (users can still
manually supply a path to llvm-config by passing
-DLLVM_CONFIG=/usr/bin/llvm-config to cmake) and adding a
deprecation warning when users try to use this option.
message(DEPRECATION) is designed for deprecation messages. It announces itself as a "CMake Deprecation Warning at CMakeLists.txt:6 (message):".
The user can silence the warning with -Wno-deprecated or make it an error with Wdeprecated since old versions of CMake: https://cmake.org/pipermail/cmake-developers/2013-July/019634.html