diff --git a/runtime/hsa-runtime/CMakeLists.txt b/runtime/hsa-runtime/CMakeLists.txt index 2d815d66e5..56ca824dd6 100644 --- a/runtime/hsa-runtime/CMakeLists.txt +++ b/runtime/hsa-runtime/CMakeLists.txt @@ -79,7 +79,8 @@ set ( BUILD_VERSION_MAJOR ${VERSION_MAJOR} ) set ( BUILD_VERSION_MINOR ${VERSION_MINOR} ) set ( BUILD_VERSION_PATCH ${VERSION_PATCH} ) set ( LIB_VERSION_STRING "${BUILD_VERSION_MAJOR}.${BUILD_VERSION_MINOR}.${BUILD_VERSION_PATCH}" ) -if ( DEFINED VERSION_BUILD ) + +if ( VERSION_BUILD ) set ( BUILD_VERSION_PATCH "${BUILD_VERSION_PATCH}-${VERSION_BUILD}" ) endif () set ( BUILD_VERSION_STRING "${BUILD_VERSION_MAJOR}.${BUILD_VERSION_MINOR}.${BUILD_VERSION_PATCH}" ) @@ -103,7 +104,7 @@ include_directories ( ${HSAKMT_INC_PATH} ) link_directories ( ${HSAKMT_LIB_PATH} ) ## ROCr build internal versioning -if ( DEFINED VERSION_BUILD ) +if ( VERSION_BUILD ) add_definitions ( -DROCR_BUILD_ID=${BUILD_VERSION_STRING} ) else () add_definitions ( -DROCR_BUILD_ID="${BUILD_VERSION_STRING}-unknown" ) diff --git a/runtime/hsa-runtime/cmake_modules/utils.cmake b/runtime/hsa-runtime/cmake_modules/utils.cmake index 74ce4389cc..0530c87f32 100644 --- a/runtime/hsa-runtime/cmake_modules/utils.cmake +++ b/runtime/hsa-runtime/cmake_modules/utils.cmake @@ -73,7 +73,7 @@ function( parse_version VERSION_STRING ) set ( TEMP_VERSION_STRING "${TEMP_VERSION_STRING}.${PATCH}" ) endif () - if ( DEFINED VERSION_BUILD ) + if ( VERSION_BUILD ) set ( VERSION_BUILD "${VERSION_BUILD}" PARENT_SCOPE ) endif ()