From d74f2d0a860907ae0cb6404737fa18b303593e4b Mon Sep 17 00:00:00 2001 From: Andrew Ng Date: Mon, 1 Jul 2019 10:58:20 +0000 Subject: [PATCH] [benchmark] Disable CMake get_git_version Disabled CMake get_git_version as it is meaningless for this in-tree build, and hardcoded a null version. Not using get_git_version avoids a refresh of the git index that is executed by get_git_version. Refreshing the index can take a considerable amount of time if the index needs to be refreshed (particularly with the mono repo). This situation can arise when building shared source on a host in VMs. Differential Revision: https://reviews.llvm.org/D63925 llvm-svn: 364742 --- llvm/utils/benchmark/CMakeLists.txt | 7 +++++-- llvm/utils/benchmark/README.LLVM | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/llvm/utils/benchmark/CMakeLists.txt b/llvm/utils/benchmark/CMakeLists.txt index 788ad48d1c4d..38bc8c6bc956 100644 --- a/llvm/utils/benchmark/CMakeLists.txt +++ b/llvm/utils/benchmark/CMakeLists.txt @@ -76,8 +76,11 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # Read the git tags to determine the project version -include(GetGitVersion) -get_git_version(GIT_VERSION) +# WARNING: This is meaningless for when the benchmark library is being built in-tree, +# so disable it and hardcode a null version. +# include(GetGitVersion) +# get_git_version(GIT_VERSION) +set(GIT_VERSION "v0.0.0") # Tell the user what versions we are using string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION ${GIT_VERSION}) diff --git a/llvm/utils/benchmark/README.LLVM b/llvm/utils/benchmark/README.LLVM index 5a20ec665ad0..c493ff4f5c64 100644 --- a/llvm/utils/benchmark/README.LLVM +++ b/llvm/utils/benchmark/README.LLVM @@ -21,3 +21,5 @@ Changes: is applied to fix building with MinGW headers for ARM * https://github.com/google/benchmark/commit/a9b31c51b1ee7ec7b31438c647123c2cbac5d956 is applied to disable exceptions in Microsoft STL when exceptions are disabled +* Disabled CMake get_git_version as it is meaningless for this in-tree build, + and hardcoded a null version