From 84c8140af77da81b27f94a51f25eeb77aa0cb888 Mon Sep 17 00:00:00 2001 From: David Salinas Date: Mon, 11 Nov 2019 13:51:20 -0500 Subject: [PATCH] update HCC version string to include commit from llvm monorepo --- CMakeLists.txt | 4 ++-- scripts/cmake/GenerateVersionFromGit.cmake | 15 +++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef9d26a01c0..b91b115321e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -208,9 +208,9 @@ if (NOT HCC_VERSION_STRING) endif() # Set HCC version string. The rule for version string is: -# HCC_VERSION_MAJOR . HCC_VERSION_MINOR . HCC_VERSION_PATCH-KALMAR_SDK_COMIT-KALMAR_FRONTEND_COMMIT-KALMAR_BACKEND_COMMIT +# HCC_VERSION_MAJOR . HCC_VERSION_MINOR . HCC_VERSION_PATCH-KALMAR_SDK_COMIT-HCC_LLVM_COMMIT add_version_info_from_git(HCC_VERSION_STRING - HCC_VERSION_PATCH KALMAR_SDK_COMMIT KALMAR_FRONTEND_COMMIT KALMAR_BACKEND_COMMIT) + HCC_VERSION_PATCH KALMAR_SDK_COMMIT HCC_LLVM_COMMIT) # set default installation path set(INSTALL_DIR_NAME "hcc") diff --git a/scripts/cmake/GenerateVersionFromGit.cmake b/scripts/cmake/GenerateVersionFromGit.cmake index 627abfc8324..9a16af2259b 100644 --- a/scripts/cmake/GenerateVersionFromGit.cmake +++ b/scripts/cmake/GenerateVersionFromGit.cmake @@ -1,4 +1,4 @@ -function(add_version_info_from_git VERS PATCH_P SDK_COMMIT_P FRONTEND_COMMIT_P BACKEND_COMMIT_P) +function(add_version_info_from_git VERS PATCH_P SDK_COMMIT_P LLVM_COMMIT_P) # get date information based on UTC # use the last two digits of year + week number + day in the week as HCC_VERSION_PATCH # use the commit date, instead of build date @@ -16,16 +16,11 @@ function(add_version_info_from_git VERS PATCH_P SDK_COMMIT_P FRONTEND_COMMIT_P B OUTPUT_VARIABLE SDK_COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND git rev-parse --short HEAD - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/clang - OUTPUT_VARIABLE FRONTEND_COMMIT + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/llvm-project + OUTPUT_VARIABLE LLVM_COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND git rev-parse --short HEAD - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/compiler - OUTPUT_VARIABLE BACKEND_COMMIT - OUTPUT_STRIP_TRAILING_WHITESPACE) - set(${VERS} "${${VERS}}.${PATCH}-${SDK_COMMIT}-${FRONTEND_COMMIT}-${BACKEND_COMMIT}" PARENT_SCOPE) + set(${VERS} "${${VERS}}.${PATCH}-${SDK_COMMIT}-${LLVM_COMMIT}" PARENT_SCOPE) set(${PATCH_P} "${PATCH}" PARENT_SCOPE) set(${SDK_COMMIT_P} "${SDK_COMMIT}" PARENT_SCOPE) - set(${FRONTEND_COMMIT_P} "${FRONTEND_COMMIT}" PARENT_SCOPE) - set(${BACKEND_COMMIT_P} "${BACKEND_COMMIT}" PARENT_SCOPE) + set(${LLVM_COMMIT_P} "${LLVM_COMMIT}" PARENT_SCOPE) endfunction(add_version_info_from_git)