From fe1ddfc6e3cd2af7d4fa333897d2a4da8d4521f4 Mon Sep 17 00:00:00 2001 From: Hideto Ueno Date: Tue, 24 May 2022 16:40:55 +0900 Subject: [PATCH] [CMake] Make version generation opt-out (#3178) This commit disables the version generation by default since it creates unnecessary warnings in out-of-tree builds. --- CMakeLists.txt | 8 +++++++- cmake/modules/GenVersionFile.cmake | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61ce8d94e0..6fb876ace6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,7 +186,13 @@ include_directories(${CIRCT_MAIN_INCLUDE_DIR}) include_directories(${CIRCT_INCLUDE_DIR}) # Set the release tag. -option(CIRCT_RELEASE_TAG_ENABLED "Emit the release tag to output." ON) +option(CIRCT_RELEASE_TAG_ENABLED "Emit the release tag to output." OFF) +if (NOT CIRCT_RELEASE_TAG_ENABLED) + message(STATUS "Version generation is disabled. To enable the version " + "generation, please set CIRCT_RELEASE_TAG_ENABLED CMake " + "variable") +endif() + set(CIRCT_RELEASE_TAG "circtorg" CACHE STRING "Prefix of the release tag (e.g. circtorg, pycde and sifive).") diff --git a/cmake/modules/GenVersionFile.cmake b/cmake/modules/GenVersionFile.cmake index 1d9726e5c5..65a31de0bc 100644 --- a/cmake/modules/GenVersionFile.cmake +++ b/cmake/modules/GenVersionFile.cmake @@ -7,7 +7,6 @@ set(GIT_DESCRIBE_DEFAULT "unknown git version") if (DRY_RUN) - message(STATUS "Version generation is disabled.") set(GIT_DESCRIBE_OUTPUT "${GIT_DESCRIBE_DEFAULT}") else () message(STATUS "Generating ${OUT_FILE} from ${IN_FILE} by `git describe --dirty --tags --match ${RELEASE_PATTERN}`")