[CMake] Installable find modules for terminfo and libffi
authorJack Andersen <jackoalan@gmail.com>
Sun, 5 Dec 2021 19:45:33 +0000 (14:45 -0500)
committerJack Andersen <jackoalan@gmail.com>
Sun, 5 Dec 2021 19:46:23 +0000 (14:46 -0500)
commitb66339575a9b541e67ce5ad2ba7e88da07cf9305
treef8aad66c46b523ae0ce11815d93494dbfb7e3419
parent296ebeb808a71e44a64e0f805cffc6e3a3bf6182
[CMake] Installable find modules for terminfo and libffi

Improves cross-distro portability of LLVM cmake package by resolving paths for
terminfo and libffi via import targets.

When LLVMExports.cmake is generated for installation, it contains absolute
library paths which are likely to be a common cause of portability issues. To
mitigate this, the discovery logic for these dependencies is refactored into
find modules which get installed alongside LLVMConfig.cmake. The result is
cleaner, cmake-friendly management of these dependencies that respect the
environment of the LLVM package importer.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D114327
llvm/cmake/config-ix.cmake
llvm/cmake/modules/FindFFI.cmake [new file with mode: 0644]
llvm/cmake/modules/FindTerminfo.cmake [new file with mode: 0644]
llvm/cmake/modules/LLVMConfig.cmake.in
llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt
llvm/lib/Support/CMakeLists.txt