Enable the semantic version mechanism for WAMR (#1374)
Use the semantic versioning (https://semver.org) to replace the current date versioning system, which is more general and is requested by some developers, e.g. issue #1357. There are three parts in the new version string: - major. Any incompatible modification on ABIs and APIs will lead to an increment in the value of major, which mainly includes: AOT calling conventions, AOT file format, wasm_export.h, wasm_c_api.h, and so on. - minor. It represents new features, including MVP/POST-MVP features, libraries, WAMR private ones, and so one. - patch. It represents patches. The new version will start from 1.0.0. Update the help info and version showing for iwasm and wamrc.
This commit is contained in:
@ -31,6 +31,7 @@
|
||||
#include "../fast-jit/jit_compiler.h"
|
||||
#endif
|
||||
#include "../common/wasm_c_api_internal.h"
|
||||
#include "../../version.h"
|
||||
|
||||
/**
|
||||
* For runtime build, BH_MALLOC/BH_FREE should be defined as
|
||||
@ -5055,3 +5056,11 @@ wasm_runtime_destroy_custom_sections(WASMCustomSection *section_list)
|
||||
}
|
||||
}
|
||||
#endif /* end of WASM_ENABLE_LOAD_CUSTOM_SECTION */
|
||||
|
||||
void
|
||||
wasm_runtime_get_version(uint32_t *major, uint32_t *minor, uint32_t *patch)
|
||||
{
|
||||
*major = WAMR_VERSION_MAJOR;
|
||||
*minor = WAMR_VERSION_MINOR;
|
||||
*patch = WAMR_VERSION_PATCH;
|
||||
}
|
||||
@ -1137,6 +1137,12 @@ WASM_RUNTIME_API_EXTERN const uint8_t *
|
||||
wasm_runtime_get_custom_section(wasm_module_t const module_comm,
|
||||
const char *name, uint32_t *len);
|
||||
|
||||
|
||||
/**
|
||||
* Get WAMR semantic version
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN void
|
||||
wasm_runtime_get_version(uint32_t *major, uint32_t *minor, uint32_t *patch);
|
||||
/* clang-format on */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
14
core/version.h
Normal file
14
core/version.h
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
/* Please don't modify this header. It is automatically generated.
|
||||
Any modification should be in config_common.cmake */
|
||||
|
||||
#ifndef _WAMR_VERSION_H_
|
||||
#define _WAMR_VERSION_H_
|
||||
#define WAMR_VERSION_MAJOR 1
|
||||
#define WAMR_VERSION_MINOR 0
|
||||
#define WAMR_VERSION_PATCH 0
|
||||
#endif
|
||||
14
core/version.h.in
Normal file
14
core/version.h.in
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
/* Please don't modify this header. It is automatically generated.
|
||||
Any modification should be in config_common.cmake */
|
||||
|
||||
#ifndef _WAMR_VERSION_H_
|
||||
#define _WAMR_VERSION_H_
|
||||
#cmakedefine WAMR_VERSION_MAJOR @WAMR_VERSION_MAJOR@
|
||||
#define WAMR_VERSION_MINOR @WAMR_VERSION_MINOR@
|
||||
#define WAMR_VERSION_PATCH @WAMR_VERSION_PATCH@
|
||||
#endif
|
||||
Reference in New Issue
Block a user