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
69 lines
2.5 KiB
CMake
69 lines
2.5 KiB
CMake
message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
|
|
message(" CMake ROCm SMI (Library) ")
|
|
message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
|
|
|
|
message("")
|
|
message("Build Configuration:")
|
|
message("--------Proj Src Dir: " ${PROJECT_SOURCE_DIR})
|
|
|
|
set(ROCM_SMI "rocm_smi")
|
|
set(ROCM_SMI_COMPONENT "lib${ROCM_SMI}")
|
|
set(ROCM_SMI_TARGET "${ROCM_SMI}64")
|
|
|
|
# Used by ESMI
|
|
set(SMI_SRC_LIST ${CMN_SRC_LIST})
|
|
|
|
## Include common cmake modules
|
|
include(utils)
|
|
|
|
################# Determine the library version #########################
|
|
set(SO_VERSION_GIT_TAG_PREFIX "rsmi_so_ver")
|
|
|
|
# VERSION_* variables should be set by get_version_from_tag
|
|
message("Package version: ${PKG_VERSION_STR}")
|
|
|
|
# Debian package specific variables
|
|
# Set a default value for the package version
|
|
get_version_from_tag("1.0.0.0" ${SO_VERSION_GIT_TAG_PREFIX} GIT)
|
|
|
|
# VERSION_* variables should be set by get_version_from_tag
|
|
if(${ROCM_PATCH_VERSION})
|
|
set(VERSION_PATCH ${ROCM_PATCH_VERSION})
|
|
set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
|
|
else()
|
|
set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}")
|
|
endif()
|
|
set(${ROCM_SMI}_VERSION_MAJOR "${CPACK_PACKAGE_VERSION_MAJOR}")
|
|
set(${ROCM_SMI}_VERSION_MINOR "${CPACK_PACKAGE_VERSION_MINOR}")
|
|
set(${ROCM_SMI}_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}")
|
|
set(${ROCM_SMI}_VERSION_BUILD "0")
|
|
set(${ROCM_SMI}_VERSION_HASH "${PKG_VERSION_HASH}")
|
|
message("SOVERSION: ${SO_VERSION_STRING}")
|
|
|
|
# Create a configure file to get version info from within library
|
|
configure_file(
|
|
"src/${ROCM_SMI_TARGET}Config.in"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/include/rocm_smi/${ROCM_SMI_TARGET}Config.h"
|
|
)
|
|
|
|
add_library(${ROCM_SMI_TARGET} ${CMN_SRC_LIST} ${CMN_INC_LIST})
|
|
target_link_libraries(${ROCM_SMI_TARGET} PRIVATE rt Threads::Threads ${CMAKE_DL_LIBS} ${FILESYSTEM_LIB})
|
|
target_include_directories(
|
|
${ROCM_SMI_TARGET}
|
|
PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${PROJECT_SOURCE_DIR}/common/shared_mutex
|
|
${DRM_INCLUDE_DIRS}
|
|
${DRM_AMDGPU_INCLUDE_DIRS}
|
|
)
|
|
|
|
# use the target_include_directories() command to specify the include directories for the target
|
|
target_include_directories(
|
|
${ROCM_SMI_TARGET}
|
|
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" "$<INSTALL_INTERFACE:${ROCM_SMI}/include>"
|
|
)
|
|
|
|
## Set the VERSION and SOVERSION values
|
|
set_property(TARGET ${ROCM_SMI_TARGET} PROPERTY SOVERSION "${VERSION_MAJOR}")
|
|
set_property(TARGET ${ROCM_SMI_TARGET} PROPERTY VERSION "${SO_VERSION_STRING}")
|