From fd6e10c84a22bc3befc4e1de8e13b488e9f7961a Mon Sep 17 00:00:00 2001 From: "Dmitriy A. Gerasimov" <dmitriy.gerasimov@demlabs.net> Date: Sun, 3 May 2020 16:05:46 +0700 Subject: [PATCH] [*] Build fixes --- CMakeLists.txt | 34 -------- changelog | 6 ++ modules/CMakeLists.txt | 27 ++++-- modules/chain/CMakeLists.txt | 25 +----- modules/channel/chain-net-srv/CMakeLists.txt | 9 +- .../dap_stream_ch_chain_net_srv_pkt.c | 9 -- modules/channel/chain-net/CMakeLists.txt | 9 +- modules/channel/chain/CMakeLists.txt | 9 +- modules/common/CMakeLists.txt | 31 +------ modules/consensus/block-poa/CMakeLists.txt | 9 +- modules/consensus/block-pow/CMakeLists.txt | 9 +- modules/consensus/dag-poa/CMakeLists.txt | 13 +-- modules/consensus/dag-pos/CMakeLists.txt | 13 +-- .../none}/CMakeLists.txt | 5 +- .../none/dap_chain_cs_none.c} | 16 +--- .../none/include/dap_chain_cs_none.h} | 0 modules/global-db/CMakeLists.txt | 8 +- modules/mempool/CMakeLists.txt | 10 +-- modules/mining/CMakeLists.txt | 82 +------------------ modules/net/CMakeLists.txt | 40 ++------- modules/net/srv/CMakeLists.txt | 23 +----- modules/net/srv/dap_chain_net_srv.c | 0 modules/net/srv/dap_chain_net_srv_common.c | 0 modules/service/app-db/CMakeLists.txt | 18 +--- modules/service/app/CMakeLists.txt | 16 +--- modules/service/datum/CMakeLists.txt | 18 +--- modules/service/mining-pool/CMakeLists.txt | 19 +---- modules/service/vpn/CMakeLists.txt | 26 +----- modules/type/block/CMakeLists.txt | 13 +-- modules/type/dag/CMakeLists.txt | 17 +--- modules/wallet/CMakeLists.txt | 24 +----- 31 files changed, 102 insertions(+), 436 deletions(-) create mode 100644 changelog rename modules/{type/no-consensus => consensus/none}/CMakeLists.txt (75%) rename modules/{type/no-consensus/dap_chain_cs_no_consensus.c => consensus/none/dap_chain_cs_none.c} (98%) rename modules/{type/no-consensus/include/dap_chain_cs_no_consensus.h => consensus/none/include/dap_chain_cs_none.h} (100%) mode change 100755 => 100644 modules/net/srv/CMakeLists.txt mode change 100755 => 100644 modules/net/srv/dap_chain_net_srv.c mode change 100755 => 100644 modules/net/srv/dap_chain_net_srv_common.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 0483b501e7..bd08eb0f36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,40 +9,6 @@ add_definitions ("-DCELLFRAME_SDK_VERSION=\"${CELLFRAME_SDK_NATIVE_VERSION}\"") add_subdirectory(dap-sdk) add_subdirectory(modules/) - -add_subdirectory(libdap) -add_subdirectory(libdap-app-cli) -add_subdirectory(libdap-crypto) -add_subdirectory(libdap-chain) -add_subdirectory(libdap-chain-common) -add_subdirectory(libdap-chain-crypto) -add_subdirectory(libdap-chain-wallet) -add_subdirectory(libdap-chain-mempool) -add_subdirectory(libdap-chain-net) -add_subdirectory(libdap-server-core) -add_subdirectory(libdap-chain-global-db) -add_subdirectory(libdap-client) -add_subdirectory(libdap-server) -add_subdirectory(libdap-stream) -add_subdirectory(libdap-stream-ch) -add_subdirectory(libdap-stream-ch-chain-net) -add_subdirectory(libdap-stream-ch-chain) -add_subdirectory(libdap-server-udp) -add_subdirectory(libdap-chain-net-srv) -add_subdirectory(libdap-chain-net-srv-app) -add_subdirectory(libdap-chain-net-srv-app-db) -add_subdirectory(libdap-chain-net-srv-datum) -add_subdirectory(libdap-chain-net-srv-datum-pool) -if(NOT (WIN32)) - add_subdirectory(libdap-chain-net-srv-vpn) -endif() - -add_subdirectory(libdap-chain-gdb) -add_subdirectory(libdap-stream-ch-chain-net-srv) -add_subdirectory(libdap-chain-cs-dag) -add_subdirectory(libdap-chain-cs-dag-poa) -add_subdirectory(libdap-chain-cs-dag-pos) - add_library(${PROJECT_NAME} STATIC cellframe-sdk.c) if(NOT (WIN32)) diff --git a/changelog b/changelog new file mode 100644 index 0000000000..91687293bf --- /dev/null +++ b/changelog @@ -0,0 +1,6 @@ + +Version 2.0 released! + + * "gdb" consensus now is "none" + * libdap-chain-crypto => modules/mining + * non-chains libs goes to dap-sdk/ diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 8e58991a09..35b0e0cf89 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -5,17 +5,28 @@ add_subdirectory(crypto) add_subdirectory(wallet) add_subdirectory(mempool) add_subdirectory(net) +add_subdirectory(net/srv) add_subdirectory(global-db) -add_subdirectory(channel/chain-net) + +# Consensus types +add_subdirectory(types/dag) +add_subdirectory(types/block) +add_subdirectory(types/no-consensus) + +# Consensuses +add_subdirectory(consensus/block-pow) +add_subdirectory(consensus/block-poa) +add_subdirectory(consensus/dag-pos) +add_subdirectory(consensus/dag-poa) + +# Stream channels add_subdirectory(channel/chain) -add_subdirectory(service) +add_subdirectory(channel/chain-net) +add_subdirectory(channel/chain-net-srv) + +# Services if(NOT (WIN32)) - add_subdirectory(libdap-chain-net-srv-vpn) + add_subdirectory(service/vpn) endif() -add_subdirectory(libdap-chain-gdb) -add_subdirectory(libdap-stream-ch-chain-net-srv) -add_subdirectory(libdap-chain-cs-dag) -add_subdirectory(libdap-chain-cs-dag-poa) -add_subdirectory(libdap-chain-cs-dag-pos) diff --git a/modules/chain/CMakeLists.txt b/modules/chain/CMakeLists.txt index b38a073578..493975f6a6 100644 --- a/modules/chain/CMakeLists.txt +++ b/modules/chain/CMakeLists.txt @@ -1,27 +1,13 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain) -set(DAP_CHAIN_SRCS - dap_chain_ledger.c - dap_chain_pvt.c - dap_chain.c - dap_chain_cs.c - dap_chain_cell.c - dap_chain_vf.c - ) +set(DAP_CHAIN_SRCS *.c) -set(DAP_CHAIN_HEADERS - dap_chain.h - dap_chain_pvt.h - dap_chain_cs.h - dap_chain_cell.h - dap_chain_ledger.h - dap_chain_vf.h - ) +set(DAP_CHAIN_HEADERS include/*.h) if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) + include_directories(../../../3rdparty/wepoll/) + include_directories(../../../3rdparty/uthash/src/) endif() add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_SRCS} ${DAP_CHAIN_HEADERS}) @@ -31,6 +17,3 @@ add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_SRCS} ${DAP_CHAIN_HEADERS}) target_link_libraries(dap_chain dap_core dap_chain_common dap_chain_crypto dap_chain_mempool dap_chain_global_db ${GLIB_LDFLAGS}) target_include_directories(dap_chain INTERFACE . ${GLIB_INCLUDE_DIRS}) - -set(${PROJECT_NAME}_DEFINITIONS CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) -set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) diff --git a/modules/channel/chain-net-srv/CMakeLists.txt b/modules/channel/chain-net-srv/CMakeLists.txt index a735ee6ae3..0be2199dfc 100644 --- a/modules/channel/chain-net-srv/CMakeLists.txt +++ b/modules/channel/chain-net-srv/CMakeLists.txt @@ -1,14 +1,15 @@ cmake_minimum_required(VERSION 3.0) project (dap_stream_ch_chain_net_srv) -set(DAP_STREAM_CH_CHAIN_NET_SRV_SRCS dap_stream_ch_chain_net_srv.c dap_stream_ch_chain_net_srv_pkt.c) +set(DAP_STREAM_CH_CHAIN_NET_SRV_SRCS *.c) +set(DAP_STREAM_CH_CHAIN_NET_SRV_HDRS include/*.h) if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) + include_directories(../../../3rdparty/wepoll/) + include_directories(../../../3rdparty/uthash/src/) endif() -add_library(${PROJECT_NAME} STATIC ${DAP_STREAM_CH_CHAIN_NET_SRV_SRCS}) +add_library(${PROJECT_NAME} STATIC ${DAP_STREAM_CH_CHAIN_NET_SRV_SRCS} ${DAP_STREAM_CH_CHAIN_NET_SRV_HDRS}) target_link_libraries(dap_stream_ch_chain_net_srv dap_core dap_crypto dap_chain_common dap_chain dap_chain_mempool dap_chain_net dap_chain_net_srv dap_server_core dap_stream dap_stream_ch dap_stream_ch_chain dap_stream_ch_chain_net) diff --git a/modules/channel/chain-net-srv/dap_stream_ch_chain_net_srv_pkt.c b/modules/channel/chain-net-srv/dap_stream_ch_chain_net_srv_pkt.c index 867211d46f..1ec2de169a 100644 --- a/modules/channel/chain-net-srv/dap_stream_ch_chain_net_srv_pkt.c +++ b/modules/channel/chain-net-srv/dap_stream_ch_chain_net_srv_pkt.c @@ -30,15 +30,6 @@ along with any CellFrame SDK based project. If not, see <http://www.gnu.org/lic #include <stdint.h> #include <string.h> -#ifdef WIN32 -#include <winsock2.h> -#include <windows.h> -#include <mswsock.h> -#include <ws2tcpip.h> -#include <io.h> -#include <pthread.h> -#endif - #include <dap_common.h> #include <dap_stream.h> #include <dap_stream_pkt.h> diff --git a/modules/channel/chain-net/CMakeLists.txt b/modules/channel/chain-net/CMakeLists.txt index f3bedc3503..44a24c1b9e 100644 --- a/modules/channel/chain-net/CMakeLists.txt +++ b/modules/channel/chain-net/CMakeLists.txt @@ -1,14 +1,15 @@ cmake_minimum_required(VERSION 3.0) project (dap_stream_ch_chain_net) -set(DAP_STREAM_CH_CHAIN_NET_SRCS dap_stream_ch_chain_net.c dap_stream_ch_chain_net_pkt.c) +set(DAP_STREAM_CH_CHAIN_NET_SRCS *.c) +set(DAP_STREAM_CH_CHAIN_NET_HDRS include/*.h) if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) + include_directories(../../../3rdparty/wepoll/) + include_directories(../../../3rdparty/uthash/src/) endif() -add_library(${PROJECT_NAME} STATIC ${DAP_STREAM_CH_CHAIN_NET_SRCS}) +add_library(${PROJECT_NAME} STATIC ${DAP_STREAM_CH_CHAIN_NET_SRCS} ${DAP_STREAM_CH_CHAIN_NET_HDRS}) target_link_libraries(dap_stream_ch_chain_net dap_core dap_crypto dap_stream dap_stream_ch dap_stream_ch_chain dap_chain_net) diff --git a/modules/channel/chain/CMakeLists.txt b/modules/channel/chain/CMakeLists.txt index ff5c4b191a..93bbfbb055 100644 --- a/modules/channel/chain/CMakeLists.txt +++ b/modules/channel/chain/CMakeLists.txt @@ -1,14 +1,15 @@ cmake_minimum_required(VERSION 3.0) project (dap_stream_ch_chain) -set(DAP_STREAM_CH_CHAIN_SRCS dap_stream_ch_chain.c dap_stream_ch_chain_pkt.c) +set(DAP_STREAM_CH_CHAIN_SRCS *.c) +set(DAP_STREAM_CH_CHAIN_SRCS include/*.h) if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) + include_directories(../../../3rdparty/wepoll/) + include_directories(../../../3rdparty/uthash/src/) endif() -add_library(${PROJECT_NAME} STATIC ${DAP_STREAM_CH_CHAIN_SRCS}) +add_library(${PROJECT_NAME} STATIC ${DAP_STREAM_CH_CHAIN_SRCS} ${DAP_STREAM_CH_CHAIN_HDRS}) target_link_libraries(dap_stream_ch_chain dap_core dap_crypto dap_chain dap_stream dap_stream_ch) diff --git a/modules/common/CMakeLists.txt b/modules/common/CMakeLists.txt index 5c27bc98d1..b9a1e49823 100644 --- a/modules/common/CMakeLists.txt +++ b/modules/common/CMakeLists.txt @@ -1,35 +1,8 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_common) -set(DAP_CHAIN_COMMON_SRCS - src/dap_chain_common.c - src/dap_chain_datum.c - src/dap_chain_datum_token.c - src/dap_chain_datum_hashtree_roots.c - src/dap_chain_datum_tx_items.c - src/dap_chain_datum_tx.c - src/dap_chain_datum_tx_out_cond.c - src/dap_chain_datum_tx_token.c - src/dap_chain_datum_tx_receipt.c - ) - -set(DAP_CHAIN_COMMON_HEADERS - include/dap_chain_common.h - include/dap_chain_datum.h - include/dap_chain_datum_token.h - include/dap_chain_datum_hashtree_roots.h - include/dap_chain_datum_tx_items.h - include/dap_chain_datum_tx.h - include/dap_chain_datum_tx_in.h - include/dap_chain_datum_tx_in_cond.h - include/dap_chain_datum_tx_out.h - include/dap_chain_datum_tx_out_cond.h - include/dap_chain_datum_tx_pkey.h - include/dap_chain_datum_tx_sig.h - include/dap_chain_datum_tx_token.h - include/dap_chain_datum_tx_receipt.h - ) - +set(DAP_CHAIN_COMMON_SRCS *.c) +set(DAP_CHAIN_COMMON_HEADERS include/*.h) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_COMMON_SRCS} ${DAP_CHAIN_COMMON_HEADERS}) diff --git a/modules/consensus/block-poa/CMakeLists.txt b/modules/consensus/block-poa/CMakeLists.txt index b56f41fb03..5a5d36de80 100644 --- a/modules/consensus/block-poa/CMakeLists.txt +++ b/modules/consensus/block-poa/CMakeLists.txt @@ -1,13 +1,8 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_cs_block_poa) -set(DAP_CHAIN_BLOCK_CS_POA_SRCS - dap_chain_cs_block_poa.c - ) - -set(DAP_CHAIN_BLOCK_CS_POA_HEADERS - dap_chain_cs_block_poa.h - ) +set(DAP_CHAIN_BLOCK_CS_POA_SRCS *.c) +set(DAP_CHAIN_BLOCK_CS_POA_HEADERS include/*.h) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_BLOCK_CS_POA_SRCS} ${DAP_CHAIN_BLOCK_CS_POA_HEADERS}) add_definitions ("-DDAP_CHAIN_BLOCK_CS_POA") diff --git a/modules/consensus/block-pow/CMakeLists.txt b/modules/consensus/block-pow/CMakeLists.txt index ec73361374..4d9b13ae14 100644 --- a/modules/consensus/block-pow/CMakeLists.txt +++ b/modules/consensus/block-pow/CMakeLists.txt @@ -1,13 +1,8 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_cs_block_pow) -set(DAP_CHAIN_BLOCK_CS_POW_SRCS - dap_chain_cs_block_pow.c - ) - -set(DAP_CHAIN_BLOCK_CS_POW_HEADERS - dap_chain_cs_block_pow.h - ) +set(DAP_CHAIN_BLOCK_CS_POW_SRCS *.c) +set(DAP_CHAIN_BLOCK_CS_POW_HEADERS include/*.h) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_BLOCK_CS_POW_SRCS} ${DAP_CHAIN_BLOCK_CS_POW_HEADERS}) diff --git a/modules/consensus/dag-poa/CMakeLists.txt b/modules/consensus/dag-poa/CMakeLists.txt index a100b31792..0cea39c868 100644 --- a/modules/consensus/dag-poa/CMakeLists.txt +++ b/modules/consensus/dag-poa/CMakeLists.txt @@ -1,17 +1,12 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_cs_dag_poa) -set(DAP_CHAIN_DAG_CS_POA_SRCS - dap_chain_cs_dag_poa.c - ) - -set(DAP_CHAIN_DAG_CS_POA_HEADERS - dap_chain_cs_dag_poa.h - ) +set(DAP_CHAIN_DAG_CS_POA_SRCS *.c) +set(DAP_CHAIN_DAG_CS_POA_HEADERS include/*.h) if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) + include_directories(../../../3rdparty/wepoll/) + include_directories(../../../3rdparty/uthash/src/) endif() add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_DAG_CS_POA_SRCS} ${DAP_CHAIN_DAG_CS_POA_HEADERS}) diff --git a/modules/consensus/dag-pos/CMakeLists.txt b/modules/consensus/dag-pos/CMakeLists.txt index 01228ca6f9..36d0f5c44f 100644 --- a/modules/consensus/dag-pos/CMakeLists.txt +++ b/modules/consensus/dag-pos/CMakeLists.txt @@ -1,17 +1,12 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_cs_dag_pos) -set(DAP_CHAIN_CS_DAG_POS_SRCS - dap_chain_cs_dag_pos.c - ) - -set(DAP_CHAIN_CS_DAG_POS_HEADERS - dap_chain_cs_dag_pos.h - ) +set(DAP_CHAIN_CS_DAG_POS_SRCS *.c) +set(DAP_CHAIN_CS_DAG_POS_HEADERS include/*.h) if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) + include_directories(../../../3rdparty/wepoll/) + include_directories(../../../3rdparty/uthash/src/) endif() add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_CS_DAG_POS_SRCS} ${DAP_CHAIN_CS_DAG_POS_HEADERS}) diff --git a/modules/type/no-consensus/CMakeLists.txt b/modules/consensus/none/CMakeLists.txt similarity index 75% rename from modules/type/no-consensus/CMakeLists.txt rename to modules/consensus/none/CMakeLists.txt index 34f88ca419..ec4118ffed 100644 --- a/modules/type/no-consensus/CMakeLists.txt +++ b/modules/consensus/none/CMakeLists.txt @@ -2,11 +2,10 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_cs_no_consensus) file(GLOB DAP_CHAIN_CS_NO_CONSENSUS_SRC *.c) -file(GLOB DAP_CHAIN_CS_NO_CONSENSUS_HDR *.h) +file(GLOB DAP_CHAIN_CS_NO_CONSENSUS_HDR include/*.h) if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) + include_directories(../../../3rdparty/uthash/src/) endif() add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_CS_NO_CONSENSUS_SRC} ${DAP_CHAIN_CS_NO_CONSENSUS_HDR}) diff --git a/modules/type/no-consensus/dap_chain_cs_no_consensus.c b/modules/consensus/none/dap_chain_cs_none.c similarity index 98% rename from modules/type/no-consensus/dap_chain_cs_no_consensus.c rename to modules/consensus/none/dap_chain_cs_none.c index 6b47cc4b51..5626597d1e 100644 --- a/modules/type/no-consensus/dap_chain_cs_no_consensus.c +++ b/modules/consensus/none/dap_chain_cs_none.c @@ -26,16 +26,6 @@ #include <stdbool.h> #include <pthread.h> -#ifdef _WIN32 -#include <winsock2.h> -#include <windows.h> -#include <mswsock.h> -#include <ws2tcpip.h> -#include <io.h> -#include <time.h> -#include <pthread.h> -#endif - #include "utlist.h" #include "dap_common.h" @@ -47,11 +37,11 @@ #include "dap_chain_global_db_driver.h" #include "dap_chain_net.h" #include "dap_chain_cs.h" -#include "dap_chain_gdb.h" +#include "dap_chain_cs_none.h" -#define LOG_TAG "dap_chain_gdb" +#define LOG_TAG "dap_chain_cs_none" -#define CONSENSUS_NAME "gdb" +#define CONSENSUS_NAME "none" typedef struct dap_chain_gdb_datum_hash_item{ char key[70]; diff --git a/modules/type/no-consensus/include/dap_chain_cs_no_consensus.h b/modules/consensus/none/include/dap_chain_cs_none.h similarity index 100% rename from modules/type/no-consensus/include/dap_chain_cs_no_consensus.h rename to modules/consensus/none/include/dap_chain_cs_none.h diff --git a/modules/global-db/CMakeLists.txt b/modules/global-db/CMakeLists.txt index 4f677d879e..e837ab4541 100644 --- a/modules/global-db/CMakeLists.txt +++ b/modules/global-db/CMakeLists.txt @@ -2,17 +2,17 @@ cmake_minimum_required(VERSION 3.1) project (dap_chain_global_db C) file(GLOB DAP_CHAIN_GLOBAL_DB_SRC *.c) -file(GLOB DAP_CHAIN_GLOBAL_DB_HDR *.h) +file(GLOB DAP_CHAIN_GLOBAL_DB_HDR include/*.h) if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) + include_directories(../../../3rdparty/wepoll/) + include_directories(../../../3rdparty/uthash/src/) endif() add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_GLOBAL_DB_SRC} ${DAP_CHAIN_GLOBAL_DB_HDR}) -add_subdirectory(libdap-cuttdb) +add_subdirectory(../../../3rdparty/cuttdb) target_link_libraries(${PROJECT_NAME} dap_core dap_crypto dap_chain dap_chain_crypto sqlite3 dap_cuttdb json-c) diff --git a/modules/mempool/CMakeLists.txt b/modules/mempool/CMakeLists.txt index 5b64979025..aa680dd6b6 100644 --- a/modules/mempool/CMakeLists.txt +++ b/modules/mempool/CMakeLists.txt @@ -2,18 +2,14 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_mempool) file(GLOB DAP_CHAIN_MEMPOOL_SRC *.c) -file(GLOB DAP_CHAIN_MEMPOOL_HDR *.h) +file(GLOB DAP_CHAIN_MEMPOOL_HDR include/*.h) if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) + include_directories(../../../3rdparty/wepoll/) + include_directories(../../../3rdparty/uthash/src/) endif() add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_MEMPOOL_SRC} ${DAP_CHAIN_MEMPOOL_HDR}) target_link_libraries(dap_chain_mempool dap_http_server dap_client dap_chain_net dap_chain_global_db dap_core) target_include_directories(dap_chain_mempool INTERFACE .) - -set(${PROJECT_NAME}_DEFINITIONS CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) - -set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) diff --git a/modules/mining/CMakeLists.txt b/modules/mining/CMakeLists.txt index 30e8fcc3f2..b3b2f16de3 100644 --- a/modules/mining/CMakeLists.txt +++ b/modules/mining/CMakeLists.txt @@ -1,87 +1,11 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_crypto) -set(DAP_CHAIN_CRYPTO_SRCS - dap_hash_slow.c - ) +set(DAP_CHAIN_CRYPTO_SRCS *.c) -set(DAP_CHAIN_CRYPTO_HEADERS - dap_hash_slow.h - ) +set(DAP_CHAIN_CRYPTO_HEADERS include/*.h) -if(NOT SUBMODULES_NO_BUILD) - - # Check whether we're on a 32-bit or 64-bit system - if(CMAKE_SIZEOF_VOID_P EQUAL "8") - set(DEFAULT_BUILD_64 ON) - else() - set(DEFAULT_BUILD_64 OFF) - endif() - option(BUILD_64 "Build for 64-bit? 'OFF' builds for 32-bit." ${DEFAULT_BUILD_64}) - -# set(_CCOPT "-Wall -O2 -pg -fPIC -fno-pie -no-pie") -# set(_LOPT "-pg") -# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") -# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_CCOPT}") -# set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${_LOPT}") - - if (NOT (TARGET dap_core)) - add_subdirectory(libdap) - endif() - if (NOT (TARGET dap_crypto)) - add_subdirectory(libdap-crypto) - endif() - if (NOT (TARGET dap_chain)) - add_subdirectory(libdap-chain) - endif() - if (NOT (TARGET dap_chain_mempool)) - add_subdirectory(libdap-chain-mempool) - endif() - if (NOT (TARGET dap_server_core)) - add_subdirectory(libdap-server-core) - endif() - if (NOT (TARGET dap_chain_net)) - add_subdirectory(libdap-chain-net) - endif() - if (NOT (TARGET dap_chain_global_db) AND NOT ANDROID) - add_subdirectory(libdap-chain-global-db) - endif() - if (NOT (TARGET dap_client)) - add_subdirectory(libdap-client) - endif() - if (NOT (TARGET dap_server)) - add_subdirectory(libdap-server) - endif() - if (NOT (TARGET dap_udp_server)) - add_subdirectory(libdap-server-udp) - endif() - if (NOT (TARGET libdap-stream)) - add_subdirectory(libdap-stream) - endif() - if (NOT (TARGET dap_stream_ch)) - add_subdirectory(libdap-stream-ch) - endif() - if (NOT (TARGET dap_stream_ch_chain)) - add_subdirectory(libdap-stream-ch-chain) - endif() - if (NOT (TARGET dap_stream_ch_chain_net)) - add_subdirectory(libdap-stream-ch-chain-net) - endif() - if (NOT (TARGET dap_chain_wallet)) - add_subdirectory(libdap-chain-wallet) - endif() - if (NOT (TARGET dap_chain_net_srv)) - add_subdirectory(libdap-chain-net-srv) - endif() - if (NOT (TARGET dap_server_http_db_auth) AND NOT ANDROID) - add_subdirectory(libdap-server-http-db-auth) - endif() - if (NOT (TARGET dap_chain_gdb)) - add_subdirectory(libdap-chain-gdb) - endif() -endif() - -add_subdirectory(monero_crypto) +add_subdirectory(../../../3rdparty/monero_crypto) include_directories("${monero_crypto_INCLUDE_DIRS}") add_definitions ("${monero_crypto_DEFINITIONS}") diff --git a/modules/net/CMakeLists.txt b/modules/net/CMakeLists.txt index 7579c48ad2..e4d7c5e545 100644 --- a/modules/net/CMakeLists.txt +++ b/modules/net/CMakeLists.txt @@ -2,31 +2,9 @@ cmake_minimum_required(VERSION 3.0) project (dap_chain_net) -set(DAP_CHAIN_NET_SRCS - dap_chain_net.c - dap_chain_net_remote.c - dap_chain_net_bugreport.c - dap_chain_node.c - dap_chain_node_cli.c - dap_chain_node_cli_cmd.c - dap_chain_node_cli_cmd_tx.c - dap_chain_node_client.c - dap_chain_node_remote.c - dap_chain_node_ping.c - ) +set(DAP_CHAIN_NET_SRCS *.c) -set(DAP_CHAIN_NET_HEADERS - dap_chain_net.h - dap_chain_net_remote.h - dap_chain_net_bugreport.h - dap_chain_node.h - dap_chain_node_cli.h - dap_chain_node_cli_cmd.h - dap_chain_node_cli_cmd_tx.h - dap_chain_node_client.h - dap_chain_node_remote.h - dap_chain_node_ping.h - ) +set(DAP_CHAIN_NET_HEADERS *.h) #if (ANDROID) # set(DAP_CHAIN_NET_HEADERS ${DAP_CHAIN_NET_HEADERS} @@ -35,12 +13,12 @@ set(DAP_CHAIN_NET_HEADERS #endif() set(IPUTILS_INCLUDE_DIRS - iputils/traceroute/ + ../../3rdparty/iputils/traceroute/ ) if(NOT (WIN32)) - file(GLOB IPUTILS_SRCS iputils/*.c iputils/traceroute/*.c) - file(GLOB IPUTILS_HEADERS iputils/*.h ${IPUTILS_INCLUDE_DIRS}*.h) + file(GLOB IPUTILS_SRCS ../../3rdparty/iputils/*.c ../../3rdparty/iputils/traceroute/*.c) + file(GLOB IPUTILS_HEADERS ../../3rdparty/iputils/*.h ${IPUTILS_INCLUDE_DIRS}*.h) endif() if(WIN32) @@ -54,8 +32,8 @@ if(WIN32) add_definitions ("-D_POSIX_") add_definitions ("-D_POSIX_THREAD_SAFE_FUNCTIONS") add_compile_definitions(_GNU_SOURCE) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) + include_directories(../../3rdparty/wepoll/) + include_directories(../../3rdparty/uthash/src/) endif() add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRCS} ${DAP_CHAIN_NET_HEADERS} ${IPUTILS_SRCS} ${IPUTILS_HEADERS}) @@ -77,7 +55,3 @@ if (!WIN32) target_include_directories(${PROJECT_NAME} PUBLIC ${IPUTILS_INCLUDE_DIRS}) endif() - -set(${PROJECT_NAME}_DEFINITIONS CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) - -set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) diff --git a/modules/net/srv/CMakeLists.txt b/modules/net/srv/CMakeLists.txt old mode 100755 new mode 100644 index 503e895e9a..a59328f7d3 --- a/modules/net/srv/CMakeLists.txt +++ b/modules/net/srv/CMakeLists.txt @@ -1,31 +1,12 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_net_srv) -set(DAP_CHAIN_NET_SRV_SRCS - dap_chain_net_srv.c - dap_chain_net_srv_order.c - dap_chain_net_srv_client.c - dap_chain_net_srv_common.c - dap_chain_net_srv_stream_session.c - ) - -set(DAP_CHAIN_NET_SRV_HEADERS - dap_chain_net_srv.h - dap_chain_net_srv_client.h - dap_chain_net_srv_order.h - dap_chain_net_srv_common.h - dap_chain_net_srv_stream_session.h - ) - +set(DAP_CHAIN_NET_SRV_SRCS *.c) +set(DAP_CHAIN_NET_SRV_HEADERS include/*.h) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_SRCS} ${DAP_CHAIN_NET_SRV_HEADERS}) target_link_libraries(dap_chain_net_srv dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_net dap_chain_wallet) target_include_directories(dap_chain_net_srv INTERFACE .) - - -set(${PROJECT_NAME}_DEFINITIONS CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) - -set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) diff --git a/modules/net/srv/dap_chain_net_srv.c b/modules/net/srv/dap_chain_net_srv.c old mode 100755 new mode 100644 diff --git a/modules/net/srv/dap_chain_net_srv_common.c b/modules/net/srv/dap_chain_net_srv_common.c old mode 100755 new mode 100644 diff --git a/modules/service/app-db/CMakeLists.txt b/modules/service/app-db/CMakeLists.txt index 44865a2084..f985c4768b 100644 --- a/modules/service/app-db/CMakeLists.txt +++ b/modules/service/app-db/CMakeLists.txt @@ -1,24 +1,12 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_net_srv_app_db) -set(DAP_CHAIN_NET_SRV_APP_DB_SRCS - dap_chain_net_srv_app_db.c - ) +set(DAP_CHAIN_NET_SRV_APP_DB_SRCS *.c) -set(DAP_CHAIN_NET_SRV_APP_DB_HEADERS - dap_chain_net_srv_app_db.h - ) - -if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) -endif() +set(DAP_CHAIN_NET_SRV_APP_DB_HEADERS include/*.h) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_APP_DB_SRCS} ${DAP_CHAIN_NET_SRV_APP_DB_HEADERS}) -target_link_libraries(dap_chain_net_srv_app_db dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_net dap_chain_net_srv dap_chain_net_srv_app) +target_link_libraries(dap_chain_net_srv_app_db dap_chain_net_srv dap_chain_net_srv_app) target_include_directories(dap_chain_net_srv_app_db INTERFACE .) -set(${PROJECT_NAME}_DEFINITIONS CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) - -set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) diff --git a/modules/service/app/CMakeLists.txt b/modules/service/app/CMakeLists.txt index a25ba245ac..9e3e5248f7 100644 --- a/modules/service/app/CMakeLists.txt +++ b/modules/service/app/CMakeLists.txt @@ -1,24 +1,12 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_net_srv_app) -set(DAP_CHAIN_NET_SRV_APP_SRCS - dap_chain_net_srv_app.c - ) +set(DAP_CHAIN_NET_SRV_APP_SRCS *.c) -set(DAP_CHAIN_NET_SRV_APP_HEADERS - dap_chain_net_srv_app.h - ) - -if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) -endif() +set(DAP_CHAIN_NET_SRV_APP_HEADERS include/*.h) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_APP_SRCS} ${DAP_CHAIN_NET_SRV_APP_HEADERS}) target_link_libraries(dap_chain_net_srv_app dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_net dap_chain_net_srv) target_include_directories(dap_chain_net_srv_app INTERFACE .) -set(${PROJECT_NAME}_DEFINITIONS CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) - -set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) diff --git a/modules/service/datum/CMakeLists.txt b/modules/service/datum/CMakeLists.txt index ca0955fc58..fdd050dd60 100644 --- a/modules/service/datum/CMakeLists.txt +++ b/modules/service/datum/CMakeLists.txt @@ -1,24 +1,12 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_net_srv_datum) -set(DAP_CHAIN_NET_SRV_DATUM_SRCS - dap_chain_net_srv_datum.c - ) +set(DAP_CHAIN_NET_SRV_DATUM_SRCS *.c) -set(DAP_CHAIN_NET_SRV_DATUM_HEADERS - dap_chain_net_srv_datum.h - ) - -if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) -endif() +set(DAP_CHAIN_NET_SRV_DATUM_HEADERS include/*.h) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_DATUM_SRCS} ${DAP_CHAIN_NET_SRV_DATUM_HEADERS}) -target_link_libraries(dap_chain_net_srv_datum dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_net dap_chain_net_srv) +target_link_libraries(dap_chain_net_srv_datum dap_chain_net_srv) target_include_directories(dap_chain_net_srv_datum INTERFACE .) -set(${PROJECT_NAME}_DEFINITIONS CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) - -set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) diff --git a/modules/service/mining-pool/CMakeLists.txt b/modules/service/mining-pool/CMakeLists.txt index 8d4b2b29c0..275db11120 100644 --- a/modules/service/mining-pool/CMakeLists.txt +++ b/modules/service/mining-pool/CMakeLists.txt @@ -1,24 +1,11 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_net_srv_datum_pool) -set(DAP_CHAIN_NET_SRV_DATUM_POOL_SRCS - dap_chain_net_srv_datum_pool.c - ) - -set(DAP_CHAIN_NET_SRV_DATUM_POOL_HEADERS - dap_chain_net_srv_datum_pool.h - ) - -if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) -endif() +set(DAP_CHAIN_NET_SRV_DATUM_POOL_SRCS *.c) +set(DAP_CHAIN_NET_SRV_DATUM_POOL_HEADERS include/*.h) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_DATUM_POOL_SRCS} ${DAP_CHAIN_NET_SRV_DATUM_POOL_HEADERS}) -target_link_libraries(dap_chain_net_srv_datum_pool dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_net dap_chain_net_srv dap_chain_net_srv_datum) +target_link_libraries(dap_chain_net_srv_datum_pool dap_chain_net_srv dap_chain_net_srv_datum) target_include_directories(dap_chain_net_srv_datum_pool INTERFACE .) -set(${PROJECT_NAME}_DEFINITIONS CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) - -set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) diff --git a/modules/service/vpn/CMakeLists.txt b/modules/service/vpn/CMakeLists.txt index fbb209f081..3f295e39c7 100644 --- a/modules/service/vpn/CMakeLists.txt +++ b/modules/service/vpn/CMakeLists.txt @@ -1,41 +1,21 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_net_srv_vpn) -set(DAP_CHAIN_NET_SRV_VPN_SRCS - dap_chain_net_srv_vpn.c - dap_chain_net_srv_vpn_cdb.c - dap_chain_net_srv_vpn_cdb_auth.c - dap_chain_net_srv_vpn_cdb_server_list.c - dap_chain_net_vpn_client.c - dap_chain_net_vpn_client_tun.c - ) +set(DAP_CHAIN_NET_SRV_VPN_SRCS *.c) -set(DAP_CHAIN_NET_SRV_VPN_HEADERS - dap_chain_net_srv_vpn.h - dap_chain_net_srv_vpn_cdb.h - dap_chain_net_srv_vpn_cdb_auth.h - dap_chain_net_srv_vpn_cdb_server_list.h - dap_chain_net_vpn_client.h - dap_chain_net_vpn_client_tun.h - ) +set(DAP_CHAIN_NET_SRV_VPN_HEADERS include/*.h) if(WIN32) - include_directories(../libdap/src/win32/) + include_directories(../../../os/win32/) include_directories(../3rdparty/wepoll/include/) include_directories(../3rdparty/uthash/src/) include_directories(../3rdparty/libjson-c/) include_directories(../3rdparty/libmagic/src/) - include_directories(../3rdparty/curl/include/) - include_directories(../3rdparty/libsqlite3/) endif() add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_VPN_SRCS} ${DAP_CHAIN_NET_SRV_VPN_HEADERS}) target_link_libraries(${PROJECT_NAME} dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_net dap_chain_net_srv) - target_include_directories(${PROJECT_NAME} INTERFACE .) -set(${PROJECT_NAME}_DEFINITIONS CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) - -set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) diff --git a/modules/type/block/CMakeLists.txt b/modules/type/block/CMakeLists.txt index c2e4fa8a42..054678eae7 100644 --- a/modules/type/block/CMakeLists.txt +++ b/modules/type/block/CMakeLists.txt @@ -1,17 +1,8 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_cs_block) -set(DAP_CHAIN_BLOCK_SRCS - dap_chain_block.c - dap_chain_cs_blocks.c - dap_chain_block_cache.c - ) - -set(DAP_CHAIN_BLOCK_HEADERS - dap_chain_block.h - dap_chain_cs_blocks.h - dap_chain_block_cache.h - ) +set(DAP_CHAIN_BLOCK_SRCS *.c) +set(DAP_CHAIN_BLOCK_HEADERS include/*.h) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_BLOCK_SRCS} ${DAP_CHAIN_BLOCK_HEADERS}) diff --git a/modules/type/dag/CMakeLists.txt b/modules/type/dag/CMakeLists.txt index 75dd7672d3..6bc479d756 100644 --- a/modules/type/dag/CMakeLists.txt +++ b/modules/type/dag/CMakeLists.txt @@ -1,21 +1,8 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_cs_dag) -set(DAP_CHAIN_DAG_SRCS - dap_chain_cs_dag.c - dap_chain_cs_dag_event.c - ) - -set(DAP_CHAIN_DAG_HEADERS - dap_chain_cs_dag.h - dap_chain_cs_dag_event.h - ) - -if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) -endif() - +set(DAP_CHAIN_DAG_SRCS *.c) +set(DAP_CHAIN_DAG_HEADERS include/*.h) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_DAG_SRCS} ${DAP_CHAIN_DAG_HEADERS}) target_link_libraries(dap_chain_cs_dag dap_core dap_crypto dap_chain dap_chain_net dap_chain_crypto dap_chain_global_db) diff --git a/modules/wallet/CMakeLists.txt b/modules/wallet/CMakeLists.txt index 7ebcaf5a99..5ca6539127 100644 --- a/modules/wallet/CMakeLists.txt +++ b/modules/wallet/CMakeLists.txt @@ -1,31 +1,11 @@ cmake_minimum_required(VERSION 2.8) project (dap_chain_wallet) -set(DAP_CHAIN_WALLET_SRCS - dap_chain_wallet.c - dap_chain_coin.c - dap_chain_wallet_ops.c - - ) - -set(DAP_CHAIN_WALLET_HEADERS - dap_chain_coin.h - dap_chain_wallet.h - dap_chain_wallet_internal.h - dap_chain_wallet_ops.h - ) - -if(WIN32) - include_directories(../3rdparty/wepoll/) - include_directories(../3rdparty/uthash/src/) -endif() +set(DAP_CHAIN_WALLET_SRCS *.c) +set(DAP_CHAIN_WALLET_HEADERS include/*.h) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_WALLET_SRCS} ${DAP_CHAIN_WALLET_HEADERS}) target_link_libraries(dap_chain_wallet dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_net) target_include_directories(dap_chain_wallet INTERFACE .) - -set(${PROJECT_NAME}_DEFINITIONS CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE) - -set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) -- GitLab