Skip to content

Commit

Permalink
Fixes to compile bitshares_toolkit with Visual Studio 2013
Browse files Browse the repository at this point in the history
  • Loading branch information
emfrias committed Apr 10, 2014
1 parent d9e4234 commit 783e656
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 34 deletions.
58 changes: 33 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ if( WIN32 )
set( ZLIB_LIBRARIES "" )
set( LEVEL_DB_DIR vendor/leveldb-win )

set(BOOST_ROOT $ENV{BOOST_ROOT})
set(Boost_USE_DEBUG_PYTHON ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_LIBS OFF)
set(BOOST_ALL_DYN_LINK ON) # force dynamic linking for all libraries
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )

set( PLATFORM_SPECIFIC_LIBS WS2_32.lib iphlpapi.lib )
add_definitions(-DBOOST_TEST_DYN_LINK)
set(CRYPTO_LIB)
set( PLATFORM_SPECIFIC_LIBS WS2_32.lib iphlpapi.lib )
set(CRYPTO_LIB)

#looks like this flag can have different default on some machines.
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
else( WIN32 )
# Apple AND Linux Options Here
find_package( ZLIB REQUIRED )
Expand Down Expand Up @@ -55,24 +53,34 @@ endif( WIN32 )

find_package( BerkeleyDB )

find_package( Boost 1.53 REQUIRED COMPONENTS
thread
date_time
system
filesystem
program_options
serialization
chrono
unit_test_framework
context
locale)
# For Boost 1.53 on windows, coroutine was not in BOOST_LIBRARYDIR and do not need it to build, but if boost versin >= 1.54, find coroutine otherwise will cause link errors
IF(NOT "${Boost_VERSION}" MATCHES "1.53(.*)")
SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES})
FIND_PACKAGE(Boost 1.54 REQUIRED COMPONENTS coroutine)
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})
ENDIF()
SET(BOOST_COMPONENTS)
LIST(APPEND BOOST_COMPONENTS thread
date_time
system
filesystem
program_options
signals
serialization
chrono
unit_test_framework
context
locale)

set(Boost_USE_STATIC_LIBS ON)
IF( WIN32 )
SET(BOOST_ROOT $ENV{BOOST_ROOT})
set(Boost_USE_MULTITHREADED ON)
set(BOOST_ALL_DYN_LINK OFF) # force dynamic linking for all libraries
ENDIF(WIN32)

FIND_PACKAGE(Boost 1.53 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
# For Boost 1.53 on windows, coroutine was not in BOOST_LIBRARYDIR and do not need it to build, but if boost versin >= 1.54, find coroutine otherwise will cause link errors
IF(NOT "${Boost_VERSION}" MATCHES "1.53(.*)")
SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES})
FIND_PACKAGE(Boost 1.54 REQUIRED COMPONENTS coroutine)
LIST(APPEND BOOST_COMPONENTS coroutine)
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})
ENDIF()

include_directories( libraries/fc/include )
include_directories( libraries/blockchain/include )
Expand Down
10 changes: 7 additions & 3 deletions libraries/blockchain/address.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#include <bts/blockchain/address.hpp>
#include <bts/blockchain/small_hash.hpp>
#include <algorithm>

#include <fc/crypto/base58.hpp>
#include <fc/crypto/ripemd160.hpp>
#include <fc/crypto/elliptic.hpp>
#include <fc/exception/exception.hpp>

namespace bts { namespace blockchain {
#include <bts/blockchain/address.hpp>
#include <bts/blockchain/small_hash.hpp>

namespace bts {
namespace blockchain {
address::address()
{
memset( addr.data, 0, sizeof(addr.data) );
Expand Down
7 changes: 5 additions & 2 deletions libraries/blockchain/block.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#include <algorithm>

#include <fc/io/raw.hpp>
#include <fc/reflect/variant.hpp>

#include <bts/blockchain/block.hpp>
#include <bts/blockchain/config.hpp>
#include <bts/blockchain/small_hash.hpp>

#include <bts/blockchain/difficulty.hpp>
#include <fc/io/raw.hpp>
#include <fc/reflect/variant.hpp>
namespace bts { namespace blockchain {


Expand Down
7 changes: 5 additions & 2 deletions libraries/blockchain/pts_address.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#include <bts/blockchain/pts_address.hpp>
#include <bts/blockchain/small_hash.hpp>
#include <algorithm>

#include <fc/crypto/base58.hpp>
#include <fc/crypto/elliptic.hpp>
#include <fc/crypto/ripemd160.hpp>
#include <fc/exception/exception.hpp>

#include <bts/blockchain/pts_address.hpp>
#include <bts/blockchain/small_hash.hpp>

namespace bts { namespace blockchain {
pts_address::pts_address()
{
Expand Down
8 changes: 6 additions & 2 deletions libraries/net/stcp_socket.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#include <bts/net/stcp_socket.hpp>
#include <assert.h>

#include <algorithm>

#include <fc/crypto/hex.hpp>
#include <fc/crypto/aes.hpp>
#include <fc/crypto/city.hpp>
#include <assert.h>
#include <fc/log/logger.hpp>
#include <fc/network/ip.hpp>
#include <fc/exception/exception.hpp>

#include <bts/net/stcp_socket.hpp>

namespace bts { namespace net {

stcp_socket::stcp_socket()
Expand Down

0 comments on commit 783e656

Please sign in to comment.