
Previously we decided to check in files that we generate with tablegen. The justification at the time was that it helped reviewers unfamiliar with `offload-tblgen` see the actual changes to the headers in PRs. After trying it for a while, it's ended up causing some headaches and is also not how tablegen is used elsewhere in LLVM. This changes our use of tablegen to be more conventional. Where possible, files are still clang-formatted, but this is no longer a hard requirement. Because `OffloadErrcodes.inc` is shared with libomptarget it now gets generated in a more appropriate place.
50 lines
1.7 KiB
CMake
50 lines
1.7 KiB
CMake
add_subdirectory(API)
|
|
|
|
add_llvm_library(
|
|
LLVMOffload SHARED
|
|
src/OffloadLib.cpp
|
|
src/OffloadImpl.cpp
|
|
|
|
LINK_COMPONENTS
|
|
FrontendOpenMP
|
|
Support
|
|
|
|
DEPENDS
|
|
OffloadAPI
|
|
PluginErrcodes
|
|
)
|
|
|
|
foreach(plugin IN LISTS LIBOMPTARGET_PLUGINS_TO_BUILD)
|
|
target_link_libraries(LLVMOffload PRIVATE omptarget.rtl.${plugin})
|
|
endforeach()
|
|
|
|
if(LLVM_HAVE_LINK_VERSION_SCRIPT)
|
|
target_link_libraries(LLVMOffload PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
|
|
endif()
|
|
|
|
target_include_directories(LLVMOffload PUBLIC
|
|
${CMAKE_CURRENT_BINARY_DIR}/API
|
|
${CMAKE_CURRENT_BINARY_DIR}/../include
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../plugins-nextgen/common/include
|
|
${CMAKE_CURRENT_BINARY_DIR}/../plugins-nextgen/common/include
|
|
)
|
|
|
|
target_compile_options(LLVMOffload PRIVATE ${offload_compile_flags})
|
|
target_link_options(LLVMOffload PRIVATE ${offload_link_flags})
|
|
|
|
target_compile_definitions(LLVMOffload PRIVATE
|
|
TARGET_NAME="Liboffload"
|
|
DEBUG_PREFIX="Liboffload"
|
|
)
|
|
|
|
set_target_properties(LLVMOffload PROPERTIES
|
|
POSITION_INDEPENDENT_CODE ON
|
|
INSTALL_RPATH "$ORIGIN"
|
|
BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/..")
|
|
install(TARGETS LLVMOffload LIBRARY COMPONENT LLVMOffload DESTINATION "${OFFLOAD_INSTALL_LIBDIR}")
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/API/OffloadAPI.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/offload)
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/API/OffloadPrint.hpp DESTINATION ${CMAKE_INSTALL_PREFIX}/include/offload)
|