From fa43a0ee959d83959467bb5d08660756c33da682 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Thu, 4 Dec 2014 09:55:54 +0100 Subject: [PATCH 1/8] removed automocs --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea2ef4b74..260493b0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_policy(SET CMP0015 NEW) +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") From 53e0ff10f5bbe9c469633c2f3e2a22bd1373379e Mon Sep 17 00:00:00 2001 From: debris Date: Fri, 5 Dec 2014 17:00:26 +0100 Subject: [PATCH 2/8] solidity compiling on windows, fixed Compiler Error C2797 --- CMakeLists.txt | 5 +++-- GlobalContext.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 260493b0e..8522130ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(..) + set(EXECUTABLE solidity) file(GLOB HEADERS "*.h") @@ -14,8 +17,6 @@ else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) - target_link_libraries(${EXECUTABLE} evmcore devcore) install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) diff --git a/GlobalContext.cpp b/GlobalContext.cpp index d8b637076..b54b93c03 100644 --- a/GlobalContext.cpp +++ b/GlobalContext.cpp @@ -33,7 +33,7 @@ namespace solidity { GlobalContext::GlobalContext(): - m_magicVariables{make_shared("block", make_shared(MagicType::Kind::BLOCK)), +m_magicVariables(vector>{make_shared("block", make_shared(MagicType::Kind::BLOCK)), make_shared("msg", make_shared(MagicType::Kind::MSG)), make_shared("tx", make_shared(MagicType::Kind::TX)), make_shared("suicide", @@ -59,7 +59,7 @@ GlobalContext::GlobalContext(): make_shared("ripemd160", make_shared(TypePointers({std::make_shared(256, IntegerType::Modifier::HASH)}), TypePointers({std::make_shared(160, IntegerType::Modifier::HASH)}), - FunctionType::Location::RIPEMD160))} + FunctionType::Location::RIPEMD160))}) { } From c7cf8c6db4b44842421a3fbabfaef84e1d745ca8 Mon Sep 17 00:00:00 2001 From: debris Date: Sun, 7 Dec 2014 11:29:38 +0100 Subject: [PATCH 3/8] solidity compiling under msvc && boosts cmake file fixed --- CMakeLists.txt | 9 ++++----- CompilerStack.h | 16 ++++++++++++++++ InterfaceHandler.h | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f2dbbcd4..895b22ae0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) include_directories(${Boost_INCLUDE_DIRS}) +include_directories(${JSONCPP_INCLUDE_DIRS}) include_directories(..) set(EXECUTABLE solidity) @@ -17,11 +18,9 @@ else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -target_link_libraries(${EXECUTABLE} evmcore devcore) -# TODO: Temporary until PR 532 https://github.com/ethereum/cpp-ethereum/pull/532 -# gets accepted. Then we can simply add jsoncpp as a dependency and not the -# whole of JSONRPC as we are doing right here -target_link_libraries(${EXECUTABLE} ${JSONRPC_LS}) +target_link_libraries(${EXECUTABLE} evmcore) +target_link_libraries(${EXECUTABLE} devcore) +target_link_libraries(${EXECUTABLE} ${JSONCPP_LIBRARIES}) install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/CompilerStack.h b/CompilerStack.h index 928815cc5..6286eb7ff 100644 --- a/CompilerStack.h +++ b/CompilerStack.h @@ -84,6 +84,22 @@ public: /// scanning the source code - this is useful for printing exception information. static bytes staticCompile(std::string const& _sourceCode, bool _optimize = false); + /// Compile under msvc results in error CC2280 + CompilerStack& operator=(const CompilerStack& _other) + { + m_scanner = _other.m_scanner; + m_globalContext = _other.m_globalContext; + m_contractASTNode = _other.m_contractASTNode; + m_parseSuccessful = _other.m_parseSuccessful; + m_interface.reset(_other.m_interface.get()); + m_userDocumentation.reset(_other.m_userDocumentation.get()); + m_devDocumentation.reset(_other.m_devDocumentation.get()); + m_compiler = _other.m_compiler; + m_interfaceHandler = _other.m_interfaceHandler; + m_bytecode = m_bytecode; + return *this; + } + private: std::shared_ptr m_scanner; std::shared_ptr m_globalContext; diff --git a/InterfaceHandler.h b/InterfaceHandler.h index 524e2903c..a31cd5c11 100644 --- a/InterfaceHandler.h +++ b/InterfaceHandler.h @@ -28,7 +28,7 @@ #include #include -#include +#include namespace dev { From ddf473aa0b3684ac2c3ad9f6135e3be6cb2b06e7 Mon Sep 17 00:00:00 2001 From: debris Date: Mon, 8 Dec 2014 12:23:10 +0100 Subject: [PATCH 4/8] common improvements --- Token.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Token.h b/Token.h index f1a94af35..eb9b4d426 100644 --- a/Token.h +++ b/Token.h @@ -296,6 +296,9 @@ class Token { public: // All token values. + // attention! msvc issue: + // http://stackoverflow.com/questions/9567868/compile-errors-after-adding-v8-to-my-project-c2143-c2059 + // @todo: avoid TOKEN_LIST macro #define T(name, string, precedence) name, enum Value { From 5104bd939f647bf7b0b418b3ed7034c1e74cc868 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Mon, 8 Dec 2014 14:12:28 +0100 Subject: [PATCH 5/8] removed few unused lines from cmakes --- CompilerStack.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/CompilerStack.h b/CompilerStack.h index 6f036d3f3..82d275498 100644 --- a/CompilerStack.h +++ b/CompilerStack.h @@ -94,22 +94,6 @@ public: /// scanning the source code - this is useful for printing exception information. static bytes staticCompile(std::string const& _sourceCode, bool _optimize = false); - /// Compile under msvc results in error CC2280 - CompilerStack& operator=(const CompilerStack& _other) - { - m_scanner = _other.m_scanner; - m_globalContext = _other.m_globalContext; - m_contractASTNode = _other.m_contractASTNode; - m_parseSuccessful = _other.m_parseSuccessful; - m_interface.reset(_other.m_interface.get()); - m_userDocumentation.reset(_other.m_userDocumentation.get()); - m_devDocumentation.reset(_other.m_devDocumentation.get()); - m_compiler = _other.m_compiler; - m_interfaceHandler = _other.m_interfaceHandler; - m_bytecode = m_bytecode; - return *this; - } - private: /** * Information pertaining to one source unit, filled gradually during parsing and compilation. From 37f7535a00697b2ad971b3e53c6dc941a64384d1 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 10 Dec 2014 11:39:41 +0100 Subject: [PATCH 6/8] jsonrpc option in cmakes, removed all warnings --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 895b22ae0..ad93609f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,10 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (APPLE) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") From ff445324a30f1c91c1b8a6b7c828d88bc4c66e78 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 10 Dec 2014 12:49:12 +0100 Subject: [PATCH 7/8] updated cmake policies --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad93609f0..44a7b9bb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_policy(SET CMP0015 NEW) # this policy was introduced in cmake 3.0 # remove if, once 3.0 will be used on unix -if (APPLE) +if (${CMAKE_MAJOR_VERSION} GREATER 2) # old policy do not use MACOSX_RPATH cmake_policy(SET CMP0042 OLD) endif() From ac5b3baa52e32846cd99c9667138ecafa4fce8d2 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Thu, 11 Dec 2014 15:06:11 +0100 Subject: [PATCH 8/8] fixed styling issues --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 44a7b9bb2..0a0b62bdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,15 +18,16 @@ include_directories(..) set(EXECUTABLE solidity) file(GLOB HEADERS "*.h") -if(ETH_STATIC) + +if (ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() +target_link_libraries(${EXECUTABLE} ${JSONCPP_LIBRARIES}) target_link_libraries(${EXECUTABLE} evmcore) target_link_libraries(${EXECUTABLE} devcore) -target_link_libraries(${EXECUTABLE} ${JSONCPP_LIBRARIES}) install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} )