[Libomptarget] Make libomptarget an LLVM library
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 15 Jul 2022 16:10:18 +0000 (12:10 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 20 Jul 2022 13:52:09 +0000 (09:52 -0400)
commit643dfd97d52e7b0c0dfbe7fd6046de9d43b3daa6
tree942f6319d52d8ee22a10ff8bdc99018661a1de6f
parent000e4264492e55a265ec92942f479e0973c221b1
[Libomptarget] Make libomptarget an LLVM library

This patch makes libomptarget depend on LLVM libraries to be built. The
reason for this is because we already have an implicit dependency on
LLVM headers for ELF identification and extraction as well as an
optional dependenly on the LLVMSupport library for time tracing
information. Furthermore, there are changes in the future that require
using more LLVM libraries, and will heavily simplify some future code as
well as open up the large amount of useful LLVM libraries to
libomptarget.

This will make "standalone" builds of `libomptarget' more difficult for
vendors wishing to ship their own. This will require a sufficiently new
version of LLVM to be installed on the system that should be picked up
by the existing handling for the implicit headers.

The things this patch changes are as follows:
  - `libomptarget.so` links against LLVMSupport and LLVMObject
  - `libomptarget.so` is a symbolic link to `libomptarget.so.15`
  - If using a shared library build, user applications will depend on LLVM
    libraries as well
  - We can now use LLVM resources in Libomptarget.

Note that this patch only changes this to apply to libomptarget itself,
not the plugins. Additional patches will be necessary for that.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D129875
openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
openmp/libomptarget/src/CMakeLists.txt