GNUInstallDirs: Possible regression sometime after 3.16
I have been testing installing llvm15 in both Haiku and Linux, where Haiku has cmake-3.24 and Linux has cmake-3.16.
With Linux/cmake-3.16, all files are installed correctly, however, with Haiku/cmake-3.24, some of the library files are missing due to GNUInstallDirs failing to set CMAKE_INSTALL_LIBDIR. Removing the use of GNUInstallDirs in a couple of the cmake files resolves the install issue, but I'm not sure if this is the correct action (and LLVM takes half a day to build from scratch!).
Warning is:
Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. Please enable at least one language before including GNUInstallDirs.
I have seen some comments about putting project(ABC)
before the include, but in these instances, there isn't a place to move it to. I'm not sure if this is a regression, or incorrect behaviour on LLVM's side. Happy to open an issue with them after confirming here.
https://github.com/llvm/llvm-project/blob/llvmorg-15.0.7/llvm/cmake/modules/AddLLVM.cmake#L1 is the troublesome invocation. Other instances seem to be fine.