Windows build coersions.

This commit is contained in:
Gav Wood 2014-07-03 15:00:22 +02:00
parent 2b7133dc13
commit d9340fb74a
2 changed files with 15 additions and 20 deletions

View File

@ -8,32 +8,29 @@ link_directories(../libethereum)
add_executable(testeth ${SRC_LIST}) add_executable(testeth ${SRC_LIST})
FIND_PACKAGE(Boost 1.53 REQUIRED COMPONENTS unit_test_framework) target_link_libraries(testeth ethereum)
target_link_libraries(testeth ethcore)
target_link_libraries(testeth secp256k1)
target_link_libraries(testeth gmp)
target_link_libraries(testeth ${CRYPTOPP_LS})
if (${TARGET_PLATFORM} STREQUAL "w64") if (${TARGET_PLATFORM} STREQUAL "w64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
target_link_libraries(testeth boost_system-mt-s)
target_link_libraries(testeth boost_filesystem-mt-s)
target_link_libraries(testeth boost_thread_win32-mt-s)
target_link_libraries(testeth gcc) target_link_libraries(testeth gcc)
target_link_libraries(testeth gdi32) target_link_libraries(testeth gdi32)
target_link_libraries(testeth ws2_32) target_link_libraries(testeth ws2_32)
target_link_libraries(testeth mswsock) target_link_libraries(testeth mswsock)
target_link_libraries(testeth shlwapi) target_link_libraries(testeth shlwapi)
target_link_libraries(testeth iphlpapi) target_link_libraries(testeth iphlpapi)
target_link_libraries(testeth cryptopp)
target_link_libraries(testeth boost_system-mt-s)
target_link_libraries(testeth boost_filesystem-mt-s)
target_link_libraries(testeth boost_thread_win32-mt-s)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
elseif (UNIX) elseif (UNIX)
find_package(Boost 1.53 REQUIRED COMPONENTS unit_test_framework)
else () else ()
target_link_libraries(testeth ${CRYPTOPP_LIBRARIES})
target_link_libraries(testeth boost_system) target_link_libraries(testeth boost_system)
target_link_libraries(testeth boost_filesystem) target_link_libraries(testeth boost_filesystem)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
target_link_libraries(testeth ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(testeth ${CMAKE_THREAD_LIBS_INIT})
endif () endif ()
target_link_libraries(testeth ethereum)
target_link_libraries(testeth secp256k1)
target_link_libraries(testeth miniupnpc)
target_link_libraries(testeth gmp)

14
vm.cpp
View File

@ -65,13 +65,12 @@ public:
h160 create(u256 _endowment, u256* _gas, bytesConstRef _init) h160 create(u256 _endowment, u256* _gas, bytesConstRef _init)
{ {
Address na = right160(sha3(rlpList(myAddress, get<1>(addresses[myAddress])))); Address na = right160(sha3(rlpList(myAddress, get<1>(addresses[myAddress]))));
if (get<0>(addresses[myAddress]) >= _endowment) /* if (get<0>(addresses[myAddress]) >= _endowment)
{ {
get<0>(addresses[myAddress]) -= _endowment;
get<1>(addresses[myAddress])++; get<1>(addresses[myAddress])++;
get<0>(addresses[na]) = _endowment; get<0>(addresses[na]) = _endowment;
// TODO: actually execute... // TODO: actually execute...
} }*/
Transaction t; Transaction t;
t.value = _endowment; t.value = _endowment;
t.gasPrice = gasPrice; t.gasPrice = gasPrice;
@ -83,13 +82,12 @@ public:
bool call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256* _gas, bytesRef _out) bool call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256* _gas, bytesRef _out)
{ {
if (get<0>(addresses[myAddress]) >= _value) /* if (get<0>(addresses[myAddress]) >= _value)
{ {
get<0>(addresses[myAddress]) -= _value;
get<1>(addresses[myAddress])++; get<1>(addresses[myAddress])++;
get<0>(addresses[_receiveAddress]) += _value; get<0>(addresses[_receiveAddress]) += _value;
// TODO: actually execute... // TODO: actually execute...
} }*/
Transaction t; Transaction t;
t.value = _value; t.value = _value;
t.gasPrice = gasPrice; t.gasPrice = gasPrice;
@ -470,7 +468,7 @@ void doTests(json_spirit::mValue& v, bool _fillin)
BOOST_AUTO_TEST_CASE(vm_tests) BOOST_AUTO_TEST_CASE(vm_tests)
{ {
// Populate tests first: // Populate tests first:
/*try try
{ {
cnote << "Populating VM tests..."; cnote << "Populating VM tests...";
json_spirit::mValue v; json_spirit::mValue v;
@ -483,7 +481,7 @@ BOOST_AUTO_TEST_CASE(vm_tests)
catch (std::exception const& e) catch (std::exception const& e)
{ {
BOOST_ERROR("Failed VM Test with Exception: " << e.what()); BOOST_ERROR("Failed VM Test with Exception: " << e.what());
}*/ }
try try
{ {