[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.
This commit is contained in:
Hideto Ueno 2022-05-24 16:40:55 +09:00 committed by GitHub
parent d983ed29b0
commit fe1ddfc6e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -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).")

View File

@ -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}`")