From cd0a5381380c9ae95074a79e5169d6fbd2fb3b6a Mon Sep 17 00:00:00 2001 From: debris Date: Sun, 7 Dec 2014 19:55:40 +0100 Subject: [PATCH] serpent compiling under msvc --- extdep/CMakeLists.txt | 22 +++++++++++----------- libdevcore/CMakeLists.txt | 5 +++++ libserpent/CMakeLists.txt | 24 ++---------------------- libserpent/rewriter.cpp | 1 + libserpent/util.cpp | 1 + lllc/CMakeLists.txt | 1 + solc/CMakeLists.txt | 4 ---- 7 files changed, 21 insertions(+), 37 deletions(-) diff --git a/extdep/CMakeLists.txt b/extdep/CMakeLists.txt index f57d6eac8..cea32c80f 100644 --- a/extdep/CMakeLists.txt +++ b/extdep/CMakeLists.txt @@ -6,7 +6,7 @@ include(eth_download.cmake) # all dependencies will be installed into this directory, separated by platform string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name) -set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install2/${_system_name}") +set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install/${_system_name}") set(ETH_DEPENDENCY_SERVER "http://poc-7.ethdev.com/precompiled/${_system_name}") file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/lib) file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include) @@ -14,22 +14,22 @@ file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/bin) if (ETH_COMPILE) # json-rpc-cpp and its dependencies - #include(compile/jsoncpp.cmake) - #include(compile/argtable2.cmake) - #include(compile/curl.cmake) - #include(compile/json-rpc-cpp.cmake) + include(compile/jsoncpp.cmake) + include(compile/argtable2.cmake) + include(compile/curl.cmake) + include(compile/json-rpc-cpp.cmake) # qt at its dependencies - #include(compile/icu.cmake) - #include(compile/jom.cmake) - #include(compile/qt.cmake) + include(compile/icu.cmake) + include(compile/jom.cmake) + include(compile/qt.cmake) # leveldb and its dependencies - #include(compile/snappy.cmake) - #include(compile/leveldb.cmake) + include(compile/snappy.cmake) + include(compile/leveldb.cmake) # cryptopp - #include(compile/cryptopp.cmake) + include(compile/cryptopp.cmake) # boost include(compile/boost.cmake) diff --git a/libdevcore/CMakeLists.txt b/libdevcore/CMakeLists.txt index 37e6f4c89..06cbe850c 100644 --- a/libdevcore/CMakeLists.txt +++ b/libdevcore/CMakeLists.txt @@ -18,6 +18,11 @@ else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() +target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY_RELEASE}) +target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY_RELEASE}) +target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY_RELEASE}) +target_link_libraries(${EXECUTABLE} ${Boost_CHRONO_LIBRARY_RELEASE}) + if (APPLE) find_package(Threads REQUIRED) target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) diff --git a/libserpent/CMakeLists.txt b/libserpent/CMakeLists.txt index 315970a7a..365b1bc9e 100644 --- a/libserpent/CMakeLists.txt +++ b/libserpent/CMakeLists.txt @@ -5,6 +5,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +include_directories(..) + set(EXECUTABLE serpent) file(GLOB HEADERS "*.h") @@ -14,32 +16,10 @@ else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) - target_link_libraries(${EXECUTABLE} lll) target_link_libraries(${EXECUTABLE} evmcore) target_link_libraries(${EXECUTABLE} devcore) -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () - install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libserpent/rewriter.cpp b/libserpent/rewriter.cpp index 3042eeb45..443457acf 100644 --- a/libserpent/rewriter.cpp +++ b/libserpent/rewriter.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "util.h" #include "lllparser.h" #include "bignum.h" diff --git a/libserpent/util.cpp b/libserpent/util.cpp index 39eeb20be..fbce5e8b5 100644 --- a/libserpent/util.cpp +++ b/libserpent/util.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "util.h" #include "bignum.h" #include diff --git a/lllc/CMakeLists.txt b/lllc/CMakeLists.txt index 9549f89e5..2e76aa6ff 100644 --- a/lllc/CMakeLists.txt +++ b/lllc/CMakeLists.txt @@ -3,6 +3,7 @@ set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) +include_directories(${Boost_INCLUDE_DIRS}) include_directories(..) set(EXECUTABLE lllc) diff --git a/solc/CMakeLists.txt b/solc/CMakeLists.txt index 303318502..203a616b4 100644 --- a/solc/CMakeLists.txt +++ b/solc/CMakeLists.txt @@ -11,10 +11,6 @@ set(EXECUTABLE solc) file(GLOB HEADERS "*.h") add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) -target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY_RELEASE}) -target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY_RELEASE}) -target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY_RELEASE}) -target_link_libraries(${EXECUTABLE} ${Boost_CHRONO_LIBRARY_RELEASE}) target_link_libraries(${EXECUTABLE} solidity) install( TARGETS ${EXECUTABLE} DESTINATION bin )