Skip to content

Commit

Permalink
update HCC version string to include commit from llvm monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
David Salinas authored and scchan committed Nov 12, 2019
1 parent 44f47d8 commit 84c8140
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
15 changes: 5 additions & 10 deletions scripts/cmake/GenerateVersionFromGit.cmake
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

0 comments on commit 84c8140

Please sign in to comment.