1##===----------------------------------------------------------------------===##
2#
3# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4# See https://llvm.org/LICENSE.txt for license information.
5# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6#
7##===----------------------------------------------------------------------===##
8#
9# Build offloading library libomptarget.so.
10#
11##===----------------------------------------------------------------------===##
12
13libomptarget_say("Building offloading runtime library libomptarget.")
14
15set(src_files
16  api.cpp
17  device.cpp
18  interface.cpp
19  MemoryManager.cpp
20  rtl.cpp
21  omptarget.cpp
22)
23
24# Build libomptarget library with libdl dependency.
25add_library(omptarget SHARED ${src_files})
26target_link_libraries(omptarget
27  ${CMAKE_DL_LIBS}
28  "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
29
30# Install libomptarget under the lib destination folder.
31install(TARGETS omptarget LIBRARY COMPONENT omptarget
32  DESTINATION "${OPENMP_INSTALL_LIBDIR}")
33