Skip to content
Snippets Groups Projects
Commit 66ca0a94 authored by alexey.stratulat's avatar alexey.stratulat
Browse files

[+] Added submodule python-cellframe and import CellFrame added inclusion of...

[+] Added submodule python-cellframe and import CellFrame added inclusion of the python-cellframe module.
parent 081aa383
No related branches found
No related tags found
1 merge request!27Support update sdk and merge plugins repo
[submodule "python-cellframe"]
path = python-cellframe
url = https://gitlab.demlabs.net/cellframe/python-cellframe.git
...@@ -6,6 +6,8 @@ set(CMAKE_COLOR_MAKEFILE ON) ...@@ -6,6 +6,8 @@ set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
add_definitions("-fpic") add_definitions("-fpic")
add_definitions("-DDAP_LOG_MT") add_definitions("-DDAP_LOG_MT")
add_subdirectory(python-cellframe)
target_compile_options(API_CellFrame PRIVATE "-fpic")
if(UNIX) if(UNIX)
add_definitions("-DDAP_OS_UNIX") add_definitions("-DDAP_OS_UNIX")
...@@ -22,7 +24,7 @@ add_library(${PROJECT_NAME} STATIC ${CHAIN_PLUGINS_PYTHON_SRCS} ${CHAIN_PLUGINS_ ...@@ -22,7 +24,7 @@ add_library(${PROJECT_NAME} STATIC ${CHAIN_PLUGINS_PYTHON_SRCS} ${CHAIN_PLUGINS_
target_link_libraries(${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME} dap_core ) target_link_libraries(${PROJECT_NAME} dap_core API_CellFrame)
target_include_directories(${PROJECT_NAME} PUBLIC include/ ) target_include_directories(${PROJECT_NAME} PUBLIC include/ )
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "dap_file_utils.h" #include "dap_file_utils.h"
#include "dap_chain_plugins_manifest.h" #include "dap_chain_plugins_manifest.h"
#include "dap_chain_plugins_list.h" #include "dap_chain_plugins_list.h"
#include "python-cellframe.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
......
Subproject commit 72321f7659412b5eab817ac1398c8053510ee981
...@@ -9,6 +9,7 @@ int dap_chain_plugins_init(dap_config_t *config){ ...@@ -9,6 +9,7 @@ int dap_chain_plugins_init(dap_config_t *config){
log_it(L_ERROR, "The directory %s was not found.", plugins_root_path); log_it(L_ERROR, "The directory %s was not found.", plugins_root_path);
return -1; return -1;
} }
PyImport_AppendInittab("CellFrame", PyInit_libCellFrame);
Py_Initialize(); Py_Initialize();
PyObject *sys_module = PyImport_ImportModule("sys"); PyObject *sys_module = PyImport_ImportModule("sys");
sys_path = PyObject_GetAttrString(sys_module, "path"); sys_path = PyObject_GetAttrString(sys_module, "path");
...@@ -107,6 +108,7 @@ void dap_chain_plugins_load_plugin(const char *dir_path, const char *name){ ...@@ -107,6 +108,7 @@ void dap_chain_plugins_load_plugin(const char *dir_path, const char *name){
if (_PyLong_AsInt(res_int) == 0){ if (_PyLong_AsInt(res_int) == 0){
dap_chain_plugins_list_add(module, name); dap_chain_plugins_list_add(module, name);
} else { } else {
PyErr_Print();
log_it(L_ERROR, "Code error %i at initialization %s plugin", _PyLong_AsInt(res_int), name); log_it(L_ERROR, "Code error %i at initialization %s plugin", _PyLong_AsInt(res_int), name);
} }
} else { } else {
......
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