From 4887dee5084d5bf28a8c0fcba63f2aa7a022a477 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Wed, 28 Mar 2018 04:18:11 +0300 Subject: [PATCH] added marketmaker_build_etomic.cmd for build etomic version needs to check, can broke something on other os --- crypto777/CMakeLists.txt | 8 ++- iguana/exchanges/CMakeLists.txt | 16 ++++++ iguana/exchanges/etomicswap/CMakeLists.txt | 8 +++ marketmaker_build_etomic.cmd | 59 ++++++++++++++++++++++ 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 marketmaker_build_etomic.cmd diff --git a/crypto777/CMakeLists.txt b/crypto777/CMakeLists.txt index dbe0cf18d..ac2316e04 100644 --- a/crypto777/CMakeLists.txt +++ b/crypto777/CMakeLists.txt @@ -2,4 +2,10 @@ file(GLOB sources "*.c") file(GLOB headers "*.h") add_library(libcrypto777 ${sources} ${headers}) target_compile_definitions(libcrypto777 PRIVATE USE_STATIC_NANOMSG) -target_link_libraries(libcrypto777 PUBLIC curl ${NANOMSG_LIBRARY}) \ No newline at end of file +target_link_libraries(libcrypto777 PUBLIC curl ${NANOMSG_LIBRARY}) +if(WIN32) +add_definitions(-DNATIVE_WINDOWS) +add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +include_directories("${CMAKE_SOURCE_DIR}/includes") +endif() diff --git a/iguana/exchanges/CMakeLists.txt b/iguana/exchanges/CMakeLists.txt index d5c1613f2..55009012b 100644 --- a/iguana/exchanges/CMakeLists.txt +++ b/iguana/exchanges/CMakeLists.txt @@ -1,14 +1,30 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) set(MM_SOURCES mm.c ../mini-gmp.c ../groestl.c ../segwit_addr.c ../keccak.c LP_etomic.c) set(MM_LIBS curl pthread libcrypto777 libjpeg libsecp256k1) +if(WIN32) +link_directories(${CMAKE_SOURCE_DIR}/marketmaker_depends/curl/build_msvc_2015_win64/lib/Release ${CMAKE_SOURCE_DIR}/marketmaker_depends/pthread-win32/bin/x64_MSVC2015.Release ${CMAKE_SOURCE_DIR}/marketmaker_depends/nanomsg/build_msvc_2015_win64/Release) +set(MM_LIBS ${MM_LIBS} nanomsg) +endif() add_executable(marketmaker-testnet ${MM_SOURCES}) add_executable(marketmaker-mainnet ${MM_SOURCES}) include_directories(../../crypto777) +if(WIN32) +target_compile_definitions(marketmaker-mainnet PRIVATE) +target_compile_definitions(marketmaker-testnet PRIVATE ETOMIC_TESTNET) +else() target_compile_definitions(marketmaker-testnet PRIVATE ETOMIC_TESTNET USE_STATIC_NANOMSG) target_compile_definitions(marketmaker-mainnet PRIVATE USE_STATIC_NANOMSG) +endif() if(UNIX) target_link_libraries(marketmaker-testnet m) target_link_libraries(marketmaker-mainnet m) endif() +if(WIN32) +add_definitions(-DNATIVE_WINDOWS) +add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +add_definitions(-D_CRT_SECURE_NO_WARNINGS) +include_directories("${CMAKE_SOURCE_DIR}/includes") +endif() target_link_libraries(marketmaker-testnet ${MM_LIBS} etomiclib-testnet) target_link_libraries(marketmaker-mainnet ${MM_LIBS} etomiclib-mainnet) diff --git a/iguana/exchanges/etomicswap/CMakeLists.txt b/iguana/exchanges/etomicswap/CMakeLists.txt index 46c2d2adf..ace34d80f 100644 --- a/iguana/exchanges/etomicswap/CMakeLists.txt +++ b/iguana/exchanges/etomicswap/CMakeLists.txt @@ -4,6 +4,14 @@ add_library(etomiclib-mainnet etomiclib.cpp etomiccurl.c) target_compile_definitions(etomiclib-testnet PRIVATE ETOMIC_TESTNET) add_executable(alice alice.c) add_executable(bob bob.c) +if(WIN32) +add_definitions(-DNATIVE_WINDOWS) +add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +add_definitions(-D_CRT_SECURE_NO_WARNINGS) +add_definitions(-DNOMINMAX) +include_directories("${CMAKE_SOURCE_DIR}/includes") +endif() include_directories("${CMAKE_SOURCE_DIR}/cpp-ethereum") target_link_libraries(etomiclib-testnet PUBLIC curl libcrypto777 ethcore devcrypto devcore pthread) target_link_libraries(etomiclib-mainnet PUBLIC curl libcrypto777 ethcore devcrypto devcore pthread) diff --git a/marketmaker_build_etomic.cmd b/marketmaker_build_etomic.cmd new file mode 100644 index 000000000..0c83b0e03 --- /dev/null +++ b/marketmaker_build_etomic.cmd @@ -0,0 +1,59 @@ +@echo off +rem (c) Decker + +echo [#1] Build nanomsg, curl and pthreads ... +Choice /M "Rebuild it? +If Errorlevel 2 Goto continue_build +call marketmaker_build_depends.cmd +:continue_build +copy marketmaker_depends\curl\build_msvc_2015_win64\lib\Release\libcurl_imp.lib marketmaker_depends\curl\build_msvc_2015_win64\lib\Release\curl.lib +copy marketmaker_depends\pthread-win32\bin\x64_MSVC2015.Release\pthread_lib.lib marketmaker_depends\pthread-win32\bin\x64_MSVC2015.Release\pthread.lib + +echo [#2] Prepare build etomic needed things ... +git submodule init +git submodule update --init --recursive +cd cpp-ethereum +rem git submodule init +rem git submodule update --init +call scripts\install_deps.bat +cd .. +mkdir build_win64_release +cd build_win64_release +cmake .. -G "Visual Studio 14 2015 Win64" + +rem Steps before build: +rem +rem crypto777\CMakeLists.txt +rem Add: +rem if(WIN32) +rem add_definitions(-DNATIVE_WINDOWS) +rem add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +rem add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +rem include_directories("${CMAKE_SOURCE_DIR}/includes") +rem endif() +rem +rem iguana\exchanges\CMakeLists.txt +rem +rem if(WIN32) +rem add_definitions(-DNATIVE_WINDOWS) +rem add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +rem add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +rem add_definitions(-D_CRT_SECURE_NO_WARNINGS) +rem include_directories("${CMAKE_SOURCE_DIR}/includes") +rem endif() +rem +rem iguana\exchanges\etomicswap\CMakeLists.txt +rem +rem if(WIN32) +rem add_definitions(-DNATIVE_WINDOWS) +rem add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +rem add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +rem add_definitions(-D_CRT_SECURE_NO_WARNINGS) +rem add_definitions(-DNOMINMAX) +rem include_directories("${CMAKE_SOURCE_DIR}/includes") +rem endif() + +echo [#3] Build marketmaker-mainnet ... + +cmake --build . --config Release --target marketmaker-mainnet +cd .. \ No newline at end of file