CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
44 lines
1.9 KiB
CMake
44 lines
1.9 KiB
CMake
# Common interface to handle creating a plugin library.
|
|
set(common_dir ${CMAKE_CURRENT_SOURCE_DIR}/common)
|
|
set(common_bin_dir ${CMAKE_CURRENT_BINARY_DIR}/common)
|
|
add_subdirectory(common)
|
|
function(add_target_library target_name lib_name)
|
|
add_library(${target_name} STATIC)
|
|
|
|
if(LLVM_LINK_LLVM_DYLIB)
|
|
set(llvm_libs LLVM)
|
|
else()
|
|
llvm_map_components_to_libnames(llvm_libs
|
|
AggressiveInstCombine Analysis BinaryFormat BitReader BitWriter CodeGen
|
|
Core Extensions FrontendOffloading InstCombine Instrumentation IPO IRReader
|
|
Linker MC Object Passes ProfileData Remarks ScalarOpts Support Target
|
|
TargetParser TransformUtils Vectorize)
|
|
endif()
|
|
llvm_update_compile_flags(${target_name})
|
|
target_include_directories(${target_name} PUBLIC ${common_dir}/include
|
|
${CMAKE_INSTALL_PREFIX}/include/offload
|
|
${common_bin_dir}/include)
|
|
if(OMPT_TARGET_DEFAULT AND LIBOMPTARGET_OMPT_SUPPORT)
|
|
target_include_directories(${target_name} PUBLIC ${common_dir}/OMPT)
|
|
endif()
|
|
|
|
target_link_libraries(${target_name} PRIVATE
|
|
PluginCommon ${OFFLOAD_PTHREAD_LIB} ${llvm_libs})
|
|
|
|
target_compile_definitions(${target_name} PRIVATE TARGET_NAME=${lib_name})
|
|
target_compile_definitions(${target_name} PRIVATE
|
|
DEBUG_PREFIX="TARGET ${lib_name} RTL")
|
|
set_target_properties(${target_name} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
endfunction()
|
|
|
|
foreach(plugin IN LISTS LIBOMPTARGET_PLUGINS_TO_BUILD)
|
|
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${plugin})
|
|
message(FATAL_ERROR "Unknown plugin target '${plugin}'")
|
|
endif()
|
|
add_subdirectory(${plugin})
|
|
endforeach()
|
|
|
|
# Make sure the parent scope can see the plugins that will be created.
|
|
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
|
|
set(LIBOMPTARGET_TESTED_PLUGINS "${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
|