Skip to content

Commit

Permalink
Fix the mono cmake build to work without mono.proj. (#47913)
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz authored Feb 5, 2021
1 parent a9424f6 commit 1fca955
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,21 @@ endif()
######################################
# EXTRACT VERSION
######################################
if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/_version.h")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/_version.h" "static char sccsid[] __attribute__((used)) = \"@(#)Version 42.42.42.42424 @Commit: AAA\";\n")
endif()
if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/runtime_version.h")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/runtime_version.h"
"#define RuntimeFileMajorVersion 42\n"
"#define RuntimeFileMinorVersion 42\n"
"#define RuntimeFileBuildVersion 42\n"
"#define RuntimeFileRevisionVersion 42424\n"
"#define RuntimeProductMajorVersion 6\n"
"#define RuntimeProductMinorVersion 0\n"
"#define RuntimeProductPatchVersion 0\n"
)
endif()

if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/_version.h" product_version_string_line REGEX "VER_PRODUCTVERSION_STR ")
string(REGEX REPLACE ".*VER_PRODUCTVERSION_STR *(.*)" "\\1" product_version_string ${product_version_string_line})
Expand Down

0 comments on commit 1fca955

Please sign in to comment.