Skip to content

Commit

Permalink
Print HERMES_RELEASE_VERSION in version string.
Browse files Browse the repository at this point in the history
Summary:
Add a preprocessor define for the `HERMES_RELEASE_VERSION` string,
which the `printHermesVersion` function uses to print the
Hermes release version.

Reviewed By: willholen

Differential Revision: D16224555

fbshipit-source-id: c583cedb88eee1f22957d78c3a8c6793e902c158
  • Loading branch information
avp authored and facebook-github-bot committed Jul 12, 2019
1 parent 6472c0f commit 084fa1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ endif()
include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)

# This must be consistent with the release_version in
# android/build.gradle and npm/package.json
set(HERMES_RELEASE_VERSION 0.1.0)

# Project options.
set(HERMESVM_GCKIND NONCONTIG_GENERATIONAL
CACHE STRING
Expand Down Expand Up @@ -160,6 +164,9 @@ endif()

set(DEFAULT_GCCELL_ID $<$<CONFIG:Debug>:ON>$<$<NOT:$<CONFIG:Debug>>:OFF>)

# Make the HERMES_RELEASE_VERSION accessible for version printing in C++.
add_definitions(-DHERMES_RELEASE_VERSION="${HERMES_RELEASE_VERSION}")

add_definitions(-DHERMESVM_GC_${HERMESVM_GCKIND})
if(HERMESVM_GC_GENERATIONAL_MARKSWEEPCOMPACT)
add_definitions(-DHERMESVM_GC_GENERATIONAL_MARKSWEEPCOMPACT)
Expand Down Expand Up @@ -500,10 +507,6 @@ set_target_properties(check-hermes PROPERTIES FOLDER "Hermes regression tests")

# This is how github release files are built.

# This must be consistent with the release_version in
# android/build.gradle and npm/package.json
set(HERMES_RELEASE_VERSION 0.1.0)

set(HERMES_GITHUB_DIR ${HERMES_BINARY_DIR}/github)
string(TOLOWER ${CMAKE_SYSTEM_NAME} HERMES_GITHUB_SYSTEM_NAME)
set(HERMES_CLI_GITHUB_FILE hermes-cli-${HERMES_GITHUB_SYSTEM_NAME}-v${HERMES_RELEASE_VERSION}.tar.gz)
Expand Down
3 changes: 3 additions & 0 deletions lib/CompilerDriver/CompilerDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,9 @@ void printHermesVersion(
const char *vmStr = "",
bool features = true) {
s << "Hermes JavaScript compiler" << vmStr << ".\n"
#ifdef HERMES_RELEASE_VERSION
<< " Hermes release version: " << HERMES_RELEASE_VERSION << "\n"
#endif
<< " HBC bytecode version: " << hermes::hbc::BYTECODE_VERSION << "\n"
<< "\n";
if (features) {
Expand Down

0 comments on commit 084fa1e

Please sign in to comment.