diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e0e0c9f7c5e376b0888bae971ec1c88ef90823c..fd8b26188261b4b12c44aac8f83cda9f832b3b62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_C_STANDARD 11) set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4) find_package (PythonLibs REQUIRED) include_directories(${PYTHON_INCLUDE_DIR} include/) -file(GLOB PYTHON_CELLFRAME_SRCS src/*.c) +file(GLOB PYTHON_CELLFRAME_SRCS CellFrame/*.c) file(GLOB PYTHON_CELLFRAME_HEADERS include/*.h) set(SUBMODULES_NO_BUILD ON) @@ -105,8 +105,8 @@ else() #python_extension_module(${PROJECT_NAME} LINKED_MODULES_VAR dap_crypto_python_module) #python_extension_module(${PROJECT_NAME} LINKED_MODULES_VAR DapServerCore) install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${PROJECT_NAME}) - install(FILES src/__init__.py DESTINATION ${PROJECT_NAME}) - install(FILES src/PublicNetworks/* DESTINATION ${PROJECT_NAME}) + install(FILES CellFrame/__init__.py DESTINATION ${PROJECT_NAME}) + install(FILES CellFrame/PublicNetworks/* DESTINATION ${PROJECT_NAME}) # install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libdap-python/libdap_python_module.so DESTINATION CellFrame/lib) # install(TARGETS dap_python_module LIBRARY DESTINATION CellFrame) # install(TARGETS dap_crypto_python_module LIBRARY DESTINATION CellFrame) @@ -149,6 +149,9 @@ target_compile_options(dap_chain_cs_dag_poa PRIVATE "-fpic") target_compile_options(dap_chain_cs_dag_pos PRIVATE "-fpic") +if (WIN32) + set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".pyd") +endif() target_link_libraries(${PROJECT_NAME} cellframe-sdk dap_python_module diff --git a/CellFrame b/CellFrame deleted file mode 120000 index 945c9b46d684f08ec84cb316e1dc0061e361f794..0000000000000000000000000000000000000000 --- a/CellFrame +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file diff --git a/src/PublicNetworks/KelvinTestNet.py b/CellFrame/PublicNetworks/KelvinTestNet.py similarity index 100% rename from src/PublicNetworks/KelvinTestNet.py rename to CellFrame/PublicNetworks/KelvinTestNet.py diff --git a/CellFrame/__init__.py b/CellFrame/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e5a782db17e69d7e7c80a046df94c49f69b5fbe5 --- /dev/null +++ b/CellFrame/__init__.py @@ -0,0 +1 @@ +from .libCellFrame import * diff --git a/src/generator_config_file.c b/CellFrame/generator_config_file.c similarity index 100% rename from src/generator_config_file.c rename to CellFrame/generator_config_file.c diff --git a/src/python-cellframe.c b/CellFrame/python-cellframe.c similarity index 100% rename from src/python-cellframe.c rename to CellFrame/python-cellframe.c diff --git a/src/wrapping_dap_enc_http.c b/CellFrame/wrapping_dap_enc_http.c similarity index 100% rename from src/wrapping_dap_enc_http.c rename to CellFrame/wrapping_dap_enc_http.c diff --git a/src/wrapping_dap_http_folder.c b/CellFrame/wrapping_dap_http_folder.c similarity index 100% rename from src/wrapping_dap_http_folder.c rename to CellFrame/wrapping_dap_http_folder.c diff --git a/src/wrapping_dap_mempool.c b/CellFrame/wrapping_dap_mempool.c similarity index 100% rename from src/wrapping_dap_mempool.c rename to CellFrame/wrapping_dap_mempool.c diff --git a/src/wrapping_dap_stream.c b/CellFrame/wrapping_dap_stream.c similarity index 100% rename from src/wrapping_dap_stream.c rename to CellFrame/wrapping_dap_stream.c diff --git a/src/wrapping_dap_stream_ctl.c b/CellFrame/wrapping_dap_stream_ctl.c similarity index 100% rename from src/wrapping_dap_stream_ctl.c rename to CellFrame/wrapping_dap_stream_ctl.c diff --git a/src/wrapping_http.c b/CellFrame/wrapping_http.c similarity index 100% rename from src/wrapping_http.c rename to CellFrame/wrapping_http.c diff --git a/README.md b/README.md index 22ad2cce13d9bc1d6c3b5e2b279bd0506494ba6a..d9db84fd2a87c496dadb14d3990f98d8f6d0a703 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,20 @@ sudo apt-get install libverto-dev sudo apt-get install lldb-7 sudo apt-get install libmemcached-dev sudo apt-get install libldb-dev -sudo apt-get install libtalloc-dev sudo apt-get install libtevent-dev sudo apt-get install libpython3-dev -sudo apt-get install traceroute -``` \ No newline at end of file +``` + + +## Windows Build +First of all you need to install msys2. It provides 3 shells. +To install dependencies, run from MSYS shell: +``` +pacman -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-file mingw-w64-x86_64-json-c mingw-w64-x86_64-python-pip +``` + +To start a build, run from MinGW 64bit shell (don't forget to change dir to python-cellframe repo): +``` +python setup.py install +``` diff --git a/src/__init__.py b/src/__init__.py deleted file mode 100644 index a6c59c1ee14056d6af117801b941599d1657b064..0000000000000000000000000000000000000000 --- a/src/__init__.py +++ /dev/null @@ -1 +0,0 @@ -#from .libCellFrame import *