Skip to content

Commit 1fca955

Browse files
authored
Fix the mono cmake build to work without mono.proj. (#47913)
1 parent a9424f6 commit 1fca955

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/mono/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,21 @@ endif()
655655
######################################
656656
# EXTRACT VERSION
657657
######################################
658+
if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/_version.h")
659+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/_version.h" "static char sccsid[] __attribute__((used)) = \"@(#)Version 42.42.42.42424 @Commit: AAA\";\n")
660+
endif()
661+
if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/runtime_version.h")
662+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/runtime_version.h"
663+
"#define RuntimeFileMajorVersion 42\n"
664+
"#define RuntimeFileMinorVersion 42\n"
665+
"#define RuntimeFileBuildVersion 42\n"
666+
"#define RuntimeFileRevisionVersion 42424\n"
667+
"#define RuntimeProductMajorVersion 6\n"
668+
"#define RuntimeProductMinorVersion 0\n"
669+
"#define RuntimeProductPatchVersion 0\n"
670+
)
671+
endif()
672+
658673
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
659674
file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/_version.h" product_version_string_line REGEX "VER_PRODUCTVERSION_STR ")
660675
string(REGEX REPLACE ".*VER_PRODUCTVERSION_STR *(.*)" "\\1" product_version_string ${product_version_string_line})

0 commit comments

Comments
 (0)