Set the SOVERSION in CMake from MAJOR/MINOR/RELEASE variables
Having the SOVERSION derived from the git tags doesn't scale well for distributions that don't have the git history while building (such as a tarball). As part of8b96ee5the strings are parsed from a header. Re-use those. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> [ROCm/amdsmi commit:ccfdb65b6f]
This commit is contained in:
committato da
Arif, Maisam
parent
f20ecc8512
commit
ef8882b4bf
@@ -59,22 +59,7 @@ endif()
|
|||||||
# VERSION_* variables should be set by get_version_from_tag
|
# VERSION_* variables should be set by get_version_from_tag
|
||||||
message("Package version: ${PKG_VERSION_STR}")
|
message("Package version: ${PKG_VERSION_STR}")
|
||||||
|
|
||||||
# Debian package specific variables
|
set(SO_VERSION_STRING "${MAJOR}.${MINOR}.${RELEASE}")
|
||||||
# Set a default value for the package version
|
|
||||||
get_version_from_tag("${${AMD_SMI_LIBS_TARGET}_VERSION_MAJOR}.${${AMD_SMI_LIBS_TARGET}_VERSION_MINOR}.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(${AMD_SMI}_VERSION_MAJOR "${VERSION_MAJOR}")
|
|
||||||
set(${AMD_SMI}_VERSION_MINOR "${VERSION_MINOR}")
|
|
||||||
set(${AMD_SMI}_VERSION_PATCH "0")
|
|
||||||
set(${AMD_SMI}_VERSION_BUILD "0")
|
|
||||||
message("SOVERSION: ${SO_VERSION_STRING}")
|
message("SOVERSION: ${SO_VERSION_STRING}")
|
||||||
|
|
||||||
add_library(${AMD_SMI} ${SRC_LIST} ${INC_LIST})
|
add_library(${AMD_SMI} ${SRC_LIST} ${INC_LIST})
|
||||||
@@ -97,7 +82,7 @@ target_include_directories(${AMD_SMI} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_
|
|||||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
|
||||||
|
|
||||||
## Set the VERSION and SOVERSION values
|
## Set the VERSION and SOVERSION values
|
||||||
set_property(TARGET ${AMD_SMI} PROPERTY SOVERSION "${VERSION_MAJOR}")
|
set_property(TARGET ${AMD_SMI} PROPERTY SOVERSION "${MAJOR}")
|
||||||
set_property(TARGET ${AMD_SMI} PROPERTY VERSION "${SO_VERSION_STRING}")
|
set_property(TARGET ${AMD_SMI} PROPERTY VERSION "${SO_VERSION_STRING}")
|
||||||
|
|
||||||
## If the library is a release, strip the target library
|
## If the library is a release, strip the target library
|
||||||
|
|||||||
Fai riferimento in un nuovo problema
Block a user