Skip to content
Snippets Groups Projects
Commit 0f6a5dc9 authored by Constantin P.'s avatar Constantin P. 💬
Browse files

Conflict resolved

parent 1c69cab2
No related branches found
No related tags found
1 merge request!1710Hotfixes 1007
...@@ -23,6 +23,17 @@ SET(CMAKE_INSTALL_PREFIX "/opt/${PROJECT_NAME}") ...@@ -23,6 +23,17 @@ SET(CMAKE_INSTALL_PREFIX "/opt/${PROJECT_NAME}")
SET(CPACK_INSTALL_PREFIX "/opt/${PROJECT_NAME}") SET(CPACK_INSTALL_PREFIX "/opt/${PROJECT_NAME}")
SET(DESTDIR "/opt/${PROJECT_NAME}") SET(DESTDIR "/opt/${PROJECT_NAME}")
string(TIMESTAMP BUILD_TIMESTAMP "%d.%m.%Y")
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message("Build date: ${BUILD_TIMESTAMP}")
message("Git SHA: ${GIT_COMMIT_HASH}")
#SET(DAP_PQLR OFF) #SET(DAP_PQLR OFF)
#possible need be setted during crosscompily #possible need be setted during crosscompily
#by default it uses dpkg --print-architecture #by default it uses dpkg --print-architecture
...@@ -32,6 +43,8 @@ SET(DESTDIR "/opt/${PROJECT_NAME}") ...@@ -32,6 +43,8 @@ SET(DESTDIR "/opt/${PROJECT_NAME}")
# init CellFrame SDK # init CellFrame SDK
add_definitions("-DDAP_VERSION=\"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CPACK_PACKAGE_VERSION_PATCH}\"") add_definitions("-DDAP_VERSION=\"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CPACK_PACKAGE_VERSION_PATCH}\"")
add_definitions("-DBUILD_TS=\"${BUILD_TIMESTAMP}\"")
add_definitions("-DBUILD_HASH=\"${GIT_COMMIT_HASH}\"")
set(SUBMODULES_NO_BUILD ON) set(SUBMODULES_NO_BUILD ON)
option(CELLFRAME_NO_OPTIMIZATION "Build without BMI BMI2 CPU instruction." ON) option(CELLFRAME_NO_OPTIMIZATION "Build without BMI BMI2 CPU instruction." ON)
......
Subproject commit d9b98ddabb638b53a96c1437d3c788e140330c90 Subproject commit e79d51990e85a470b2bed6783c246d569682281e
...@@ -145,6 +145,9 @@ void set_global_sys_dir(const char *dir) ...@@ -145,6 +145,9 @@ void set_global_sys_dir(const char *dir)
int main( int argc, const char **argv ) int main( int argc, const char **argv )
{ {
if ( argv[1] && !dap_strcmp("-version", argv[1]) )
return printf("%s\n", dap_node_version()), 0;
dap_server_t *l_server = NULL; // DAP Server instance dap_server_t *l_server = NULL; // DAP Server instance
bool l_debug_mode = true; bool l_debug_mode = true;
bool bServerEnabled = false; bool bServerEnabled = false;
...@@ -607,3 +610,14 @@ void exit_if_server_already_running( void ) { ...@@ -607,3 +610,14 @@ void exit_if_server_already_running( void ) {
#endif #endif
} }
#ifndef BUILD_HASH
#define BUILD_HASH "0000000" // 0000000 means uninitialized
#endif
#ifndef BUILD_TS
#define BUILD_TS "undefined"
#endif
const char *dap_node_version() {
return "CellframeNode, " DAP_VERSION ", " BUILD_TS ", " BUILD_HASH;
}
\ No newline at end of file
...@@ -13,6 +13,7 @@ void set_global_sys_dir(const char *dir); ...@@ -13,6 +13,7 @@ void set_global_sys_dir(const char *dir);
typedef bool (*dap_notify_data_user_callback_t)(const char *data); typedef bool (*dap_notify_data_user_callback_t)(const char *data);
void dap_notify_data_set_user_callback(dap_notify_data_user_callback_t callback); void dap_notify_data_set_user_callback(dap_notify_data_user_callback_t callback);
char *dap_cli_exec(int argc, char **argv); char *dap_cli_exec(int argc, char **argv);
const char *dap_node_version();
}; };
#endif //NODE_CELLFRAME_NODE_H #endif //NODE_CELLFRAME_NODE_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment