1 ##===----------------------------------------------------------------------===##
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
7 ##===----------------------------------------------------------------------===##
9 # Build offloading library libomptarget.so.
11 ##===----------------------------------------------------------------------===##
13 libomptarget_say("Building offloading runtime library libomptarget.")
15 add_llvm_library(omptarget
27 ADDITIONAL_HEADER_DIRS
28 ${LIBOMPTARGET_INCLUDE_DIR}
40 target_include_directories(omptarget PRIVATE ${LIBOMPTARGET_INCLUDE_DIR})
42 if (LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
43 target_link_libraries(omptarget PRIVATE
44 "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
47 # libomptarget.so needs to be aware of where the plugins live as they
48 # are now separated in the build directory.
49 set_target_properties(omptarget PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/..")
50 install(TARGETS omptarget LIBRARY COMPONENT omptarget DESTINATION "${OPENMP_INSTALL_LIBDIR}")