diff --git a/extdep/CMakeLists.txt b/extdep/CMakeLists.txt index cea32c80f..f57d6eac8 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}/install/${_system_name}") +set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install2/${_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/extdep/compile/boost.cmake b/extdep/compile/boost.cmake new file mode 100644 index 000000000..aaf892cc9 --- /dev/null +++ b/extdep/compile/boost.cmake @@ -0,0 +1,19 @@ +if(APPLE) + +elseif(WIN32) +set(boost_address_model) +# on windows 64: +# set(boost_address_model address-model=64) + +set(boost_targets --with-filesystem --with-system --with-thread --with-date_time --with-regex --with-test) +ExternalProject_Add(boost + URL http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz + BINARY_DIR boost-prefix/src/boost + CONFIGURE_COMMAND ./bootstrap.bat + BUILD_COMMAND ./b2.exe -j4 --build-type=complete link=static runtime-link=shared variant=debug,release threading=multi ${boost_addressModel} ${boost_targets} install --prefix=${ETH_DEPENDENCY_INSTALL_DIR} + INSTALL_COMMAND cmake -E rename ${ETH_DEPENDENCY_INSTALL_DIR}/include/boost-1_55/boost ${ETH_DEPENDENCY_INSTALL_DIR}/include/boost + ) +else() + +endif() + diff --git a/extdep/compile/configure.bat b/extdep/compile/configure.bat new file mode 100644 index 000000000..bd810938a --- /dev/null +++ b/extdep/compile/configure.bat @@ -0,0 +1,111 @@ +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +:: Contact: http://www.qt-project.org/legal +:: +:: This file is part of the tools applications of the Qt Toolkit. +:: +:: $QT_BEGIN_LICENSE:LGPL$ +:: Commercial License Usage +:: Licensees holding valid commercial Qt licenses may use this file in +:: accordance with the commercial license agreement provided with the +:: Software or, alternatively, in accordance with the terms contained in +:: a written agreement between you and Digia. For licensing terms and +:: conditions see http://qt.digia.com/licensing. For further information +:: use the contact form at http://qt.digia.com/contact-us. +:: +:: GNU Lesser General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU Lesser +:: General Public License version 2.1 as published by the Free Software +:: Foundation and appearing in the file LICENSE.LGPL included in the +:: packaging of this file. Please review the following information to +:: ensure the GNU Lesser General Public License version 2.1 requirements +:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +:: +:: In addition, as a special exception, Digia gives you certain additional +:: rights. These rights are described in the Digia Qt LGPL Exception +:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +:: +:: GNU General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU +:: General Public License version 3.0 as published by the Free Software +:: Foundation and appearing in the file LICENSE.GPL included in the +:: packaging of this file. Please review the following information to +:: ensure the GNU General Public License version 3.0 requirements will be +:: met: http://www.gnu.org/copyleft/gpl.html. +:: +:: +:: $QT_END_LICENSE$ +:: +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +@echo off +set QTSRC=%~dp0 +set QTDIR=%CD% +::if not exist %QTSRC%\.gitignore goto sconf +echo Please wait while bootstrapping configure ... + +for %%C in (cl.exe icl.exe g++.exe perl.exe) do set %%C=%%~$PATH:C + +if "%perl.exe%" == "" ( + echo Perl not found in PATH. Aborting. >&2 + exit /b 1 +) +if not exist mkspecs ( + md mkspecs + if errorlevel 1 goto exit +) +perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir %QTDIR% %QTSRC% +if errorlevel 1 goto exit + +if not exist tools\configure ( + md tools\configure + if errorlevel 1 goto exit +) +cd tools\configure +if errorlevel 1 goto exit + +echo #### Generated by configure.bat - DO NOT EDIT! ####> Makefile +echo/>> Makefile +for /f "tokens=3 usebackq" %%V in (`findstr QT_VERSION_STR %QTSRC%\src\corelib\global\qglobal.h`) do @echo QTVERSION = %%~V>> Makefile +if not "%cl.exe%" == "" ( + echo CXX = cl>>Makefile + echo EXTRA_CXXFLAGS =>>Makefile + rem This must have a trailing space. + echo QTSRC = %QTSRC% >> Makefile + set tmpl=win32 + set make=nmake +) else if not "%icl.exe%" == "" ( + echo CXX = icl>>Makefile + echo EXTRA_CXXFLAGS = /Zc:forScope>>Makefile + rem This must have a trailing space. + echo QTSRC = %QTSRC% >> Makefile + set tmpl=win32 + set make=nmake +) else if not "%g++.exe%" == "" ( + echo CXX = g++>>Makefile + echo EXTRA_CXXFLAGS =>>Makefile + rem This must NOT have a trailing space. + echo QTSRC = %QTSRC:\=/%>> Makefile + set tmpl=mingw + set make=mingw32-make +) else ( + echo No suitable compiler found in PATH. Aborting. >&2 + cd ..\.. + exit /b 1 +) +echo/>> Makefile +type %QTSRC%tools\configure\Makefile.%tmpl% >> Makefile + +%make% +if errorlevel 1 (cd ..\.. & exit /b 1) + +cd ..\.. + +:conf +configure.exe -srcdir %QTSRC% %* +goto exit + +:sconf +%QTSRC%\configure.exe %* +:exit diff --git a/libsolidity/CMakeLists.txt b/libsolidity/CMakeLists.txt index 0f2dbbcd4..895b22ae0 100644 --- a/libsolidity/CMakeLists.txt +++ b/libsolidity/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/libsolidity/CompilerStack.h b/libsolidity/CompilerStack.h index 928815cc5..6286eb7ff 100644 --- a/libsolidity/CompilerStack.h +++ b/libsolidity/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/libsolidity/InterfaceHandler.h b/libsolidity/InterfaceHandler.h index 524e2903c..a31cd5c11 100644 --- a/libsolidity/InterfaceHandler.h +++ b/libsolidity/InterfaceHandler.h @@ -28,7 +28,7 @@ #include #include -#include +#include namespace dev { diff --git a/lllc/CMakeLists.txt b/lllc/CMakeLists.txt index 0ca19fab9..9549f89e5 100644 --- a/lllc/CMakeLists.txt +++ b/lllc/CMakeLists.txt @@ -3,16 +3,12 @@ set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) -include_directories(${Boost_INCLUDE_DIRS}) include_directories(..) set(EXECUTABLE lllc) -if(ETH_STATIC) - add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) -else() - add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) -endif() +file(GLOB HEADERS "*.h") +add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) add_dependencies(${EXECUTABLE} BuildInfo.h) diff --git a/solc/CMakeLists.txt b/solc/CMakeLists.txt index ab402ed8e..203a616b4 100644 --- a/solc/CMakeLists.txt +++ b/solc/CMakeLists.txt @@ -3,11 +3,13 @@ set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) +include_directories(${Boost_INCLUDE_DIRS}) include_directories(..) set(EXECUTABLE solc) -add_executable(${EXECUTABLE} ${SRC_LIST}) +file(GLOB HEADERS "*.h") +add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) target_link_libraries(${EXECUTABLE} solidity)