[libomptarget] Move header files and CMake library definition

Future patches will add (private) header files in src/ that should
not be visible to plugins, so move the "public" ones to a new
include/ directory. This is still internal in a sense that the
contained files won't be installed for the user.
Similarly, the target agnostic offloading library should be built
directly in src/. The parent directory is responsible for finding
dependencies and including all subdirectories.

Differential Revision: https://reviews.llvm.org/D40797

llvm-svn: 319968
This commit is contained in:
Jonas Hahnfeld 2017-12-06 21:59:04 +00:00
parent 0192818ffe
commit 2559fbdf08
5 changed files with 32 additions and 17 deletions

View File

@ -7,7 +7,7 @@
#
##===----------------------------------------------------------------------===##
#
# Build offloading library libomptarget.so.
# Build offloading library and related plugins.
#
##===----------------------------------------------------------------------===##
@ -44,8 +44,6 @@ set (LIBOMPTARGET_SYSTEM_TARGETS "")
set(LIBOMPTARGET_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LIBOMPTARGET_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
libomptarget_say("Building offloading runtime library libomptarget.")
# If building this library in debug mode, we define a macro to enable
# dumping progress messages at runtime.
string( TOLOWER "${CMAKE_BUILD_TYPE}" LIBOMPTARGET_CMAKE_BUILD_TYPE)
@ -55,20 +53,10 @@ if(LIBOMPTARGET_CMAKE_BUILD_TYPE MATCHES debug)
add_definitions(-O0)
endif()
set(src_files
src/omptarget.cpp
)
include_directories(include)
include_directories(src/)
# Build libomptarget library with libdl dependency.
add_library(omptarget SHARED ${src_files})
target_link_libraries(omptarget
${CMAKE_DL_LIBS}
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
# Install libomptarget under the lib destination folder.
install(TARGETS omptarget LIBRARY DESTINATION lib${OPENMP_LIBDIR_SUFFIX})
# Build target agnostic offloading library.
add_subdirectory(src)
# Retrieve the path to the resulting library so that it can be used for
# testing.

View File

@ -48,7 +48,7 @@ enum tgt_map_type {
OMP_TGT_MAPTYPE_LITERAL = 0x100,
// mapping is implicit
OMP_TGT_MAPTYPE_IMPLICIT = 0x200,
// member of struct, member given by 4 MSBs - 1
// member of struct, member given by 16 MSBs - 1
OMP_TGT_MAPTYPE_MEMBER_OF = 0xffff000000000000
};

View File

@ -0,0 +1,27 @@
##===----------------------------------------------------------------------===##
#
# The LLVM Compiler Infrastructure
#
# This file is dual licensed under the MIT and the University of Illinois Open
# Source Licenses. See LICENSE.txt for details.
#
##===----------------------------------------------------------------------===##
#
# Build offloading library libomptarget.so.
#
##===----------------------------------------------------------------------===##
libomptarget_say("Building offloading runtime library libomptarget.")
set(src_files
omptarget.cpp
)
# Build libomptarget library with libdl dependency.
add_library(omptarget SHARED ${src_files})
target_link_libraries(omptarget
${CMAKE_DL_LIBS}
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
# Install libomptarget under the lib destination folder.
install(TARGETS omptarget LIBRARY DESTINATION lib${OPENMP_LIBDIR_SUFFIX})