Skip to content

Commit

Permalink
Merge pull request EOSIO#105 from EOSIO/feature/encapsulate_boost
Browse files Browse the repository at this point in the history
added boost, changed cmake system
  • Loading branch information
larryk85 authored Sep 28, 2018
2 parents d7b984b + c7185dc commit 759a228
Show file tree
Hide file tree
Showing 3,627 changed files with 496,115 additions and 58 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
18 changes: 12 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ add_subdirectory(external)

set(WASM_SDK_BUILD true)

configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchainBuild.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/EosioWasmToolchain.cmake @ONLY)
### Configure the EosioWasmToolchain.cmakes
set(SYSROOT_DIR ${CMAKE_BINARY_DIR})
configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake @ONLY)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/lib/cmake")
include(EosioWasmToolchain)
set(SYSROOT_DIR ${CMAKE_INSTALL_PREFIX})
configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake @ONLY)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt")
include(EosioWasmToolchain)

if ("${CORE_SYMBOL_NAME}" STREQUAL "")
set( CORE_SYMBOL_NAME "SYS" )
Expand All @@ -47,8 +50,11 @@ message( STATUS "Using '${CORE_SYMBOL_NAME}' as CORE symbol name" )
# install examples
#install(DIRECTORY examples DESTINATION "${CMAKE_INSTALL_PREFIX}")

configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake)
install(FILES ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/eosio.cdt)

configure_file(${CMAKE_SOURCE_DIR}/modules/eosio.cdt-config.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/eosio.cdt-config.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/eosio.cdt-config.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/eosio.cdt)

configure_file(${CMAKE_SOURCE_DIR}/eosio.imports.in ${CMAKE_BINARY_DIR}/eosio.imports COPYONLY)
install(FILES ${CMAKE_BINARY_DIR}/eosio.imports DESTINATION ${CMAKE_INSTALL_PREFIX})

Expand Down
15 changes: 15 additions & 0 deletions InstallClang.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# install clang and llvm
set(CLANG_BIN_DIR ${CMAKE_BINARY_DIR}/EosioClang-prefix/src/EosioClang-build/bin)

add_custom_command( TARGET EosioClang POST_BUILD COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin )

add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CLANG_BIN_DIR}/eosio-cpp ${CMAKE_BINARY_DIR}/bin/ )
add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CLANG_BIN_DIR}/eosio-cc ${CMAKE_BINARY_DIR}/bin/ )
add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CLANG_BIN_DIR}/eosio-abigen ${CMAKE_BINARY_DIR}/bin/ )
add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CLANG_BIN_DIR}/eosio-ld ${CMAKE_BINARY_DIR}/bin/ )
add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CLANG_BIN_DIR}/wasm-ld ${CMAKE_BINARY_DIR}/bin/ )
add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CLANG_BIN_DIR}/llvm-ar ${CMAKE_BINARY_DIR}/bin/eosio-ar )
add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CLANG_BIN_DIR}/llvm-ranlib ${CMAKE_BINARY_DIR}/bin/eosio-ranlib )
add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CLANG_BIN_DIR}/llvm-nm ${CMAKE_BINARY_DIR}/bin/eosio-nm )
add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CLANG_BIN_DIR}/clang-7 ${CMAKE_BINARY_DIR}/bin/ )
add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CLANG_BIN_DIR}/../lib/LLVMEosioApply${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_BINARY_DIR}/bin/ )

install(FILES ${CLANG_BIN_DIR}/llvm-ranlib
DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
Expand Down Expand Up @@ -53,6 +67,7 @@ install(FILES ${CLANG_BIN_DIR}/eosio-abigen
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(FILES ${CLANG_BIN_DIR}/../lib/LLVMEosioApply${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})

install(CODE "
execute_process(COMMAND ln -sf
${CMAKE_INSTALL_FULL_BINDIR}/clang-7
Expand Down
2 changes: 1 addition & 1 deletion eosio_llvm
Submodule eosio_llvm updated 1 files
+1 −1 tools/clang
3 changes: 3 additions & 0 deletions external/wabt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ if (NOT EMSCRIPTEN)
)
endfunction()
wabt_executable(eosio-pp src/tools/postpass.cc)
add_custom_command( TARGET eosio-pp POST_BUILD COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin )
add_custom_command( TARGET eosio-pp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:eosio-pp> ${CMAKE_BINARY_DIR}/bin/ )

# wat2wasm
wabt_executable(wat2wasm src/tools/wat2wasm.cc)

Expand Down
9 changes: 8 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@
create_symlink "wasm2wat eosio-wasm2wast"
create_symlink "wat2wasm eosio-wast2wasm"
}


create_cmake_symlink() {
mkdir -p /usr/local/lib/cmake/eosio.cdt
pushd /usr/local/lib/cmake/eosio.cdt &> /dev/null
ln -sf ../../../eosio.cdt/lib/cmake/eosio.cdt/$1 $1
popd &> /dev/null
}
if [ ! -d "${BUILD_DIR}" ]; then
printf "\\n\\tError, build.sh has not ran. Please run ./build.sh first!\\n\\n"
exit -1
Expand All @@ -87,6 +93,7 @@
popd &> /dev/null

install_symlinks
create_cmake_symlink "eosio.cdt-config.cmake"

printf "\n${bldred}\t ___ ___ ___ ___\n"
printf "\t / /\\ / /\\ / /\\ ___ / /\\ \n"
Expand Down
3 changes: 2 additions & 1 deletion libraries/boost/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/../)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/include/boost DESTINATION ${CMAKE_BINARY_DIR}/include)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/boost DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/)
85 changes: 85 additions & 0 deletions libraries/boost/include/boost/assert.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
//
// boost/assert.hpp - BOOST_ASSERT(expr)
// BOOST_ASSERT_MSG(expr, msg)
// BOOST_VERIFY(expr)
// BOOST_VERIFY_MSG(expr, msg)
// BOOST_ASSERT_IS_VOID
//
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2007, 2014 Peter Dimov
// Copyright (c) Beman Dawes 2011
// Copyright (c) 2015 Ion Gaztanaga
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// Note: There are no include guards. This is intentional.
//
// See http://www.boost.org/libs/assert/assert.html for documentation.
//

//
// Stop inspect complaining about use of 'assert':
//
// boostinspect:naassert_macro
//

//
// BOOST_ASSERT, BOOST_ASSERT_MSG, BOOST_ASSERT_IS_VOID
//

#undef BOOST_ASSERT
#undef BOOST_ASSERT_MSG
#undef BOOST_ASSERT_IS_VOID

#if defined(BOOST_DISABLE_ASSERTS) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && defined(NDEBUG) )

# define BOOST_ASSERT(expr) ((void)0)
# define BOOST_ASSERT_MSG(expr, msg) ((void)0)
# define BOOST_ASSERT_IS_VOID

#elif defined(BOOST_ENABLE_ASSERT_HANDLER) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && !defined(NDEBUG) )

#include <boost/config.hpp> // for BOOST_LIKELY
#include <boost/current_function.hpp>

namespace boost
{
void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line); // user defined
} // namespace boost

#define BOOST_ASSERT(expr) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
#define BOOST_ASSERT_MSG(expr, msg) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))

#else

# include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same

# define BOOST_ASSERT(expr) assert(expr)
# define BOOST_ASSERT_MSG(expr, msg) assert((expr)&&(msg))
#if defined(NDEBUG)
# define BOOST_ASSERT_IS_VOID
#endif

#endif

//
// BOOST_VERIFY, BOOST_VERIFY_MSG
//

#undef BOOST_VERIFY
#undef BOOST_VERIFY_MSG

#if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) )

# define BOOST_VERIFY(expr) ((void)(expr))
# define BOOST_VERIFY_MSG(expr, msg) ((void)(expr))

#else

# define BOOST_VERIFY(expr) BOOST_ASSERT(expr)
# define BOOST_VERIFY_MSG(expr, msg) BOOST_ASSERT_MSG(expr,msg)

#endif
67 changes: 67 additions & 0 deletions libraries/boost/include/boost/config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Boost config.hpp configuration header file ------------------------------//

// (C) Copyright John Maddock 2002.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

// See http://www.boost.org/libs/config for most recent version.

// Boost config.hpp policy and rationale documentation has been moved to
// http://www.boost.org/libs/config
//
// CAUTION: This file is intended to be completely stable -
// DO NOT MODIFY THIS FILE!
//

#ifndef BOOST_CONFIG_HPP
#define BOOST_CONFIG_HPP

// if we don't have a user config, then use the default location:
#if !defined(BOOST_USER_CONFIG) && !defined(BOOST_NO_USER_CONFIG)
# define BOOST_USER_CONFIG <boost/config/user.hpp>
#if 0
// For dependency trackers:
# include <boost/config/user.hpp>
#endif
#endif
// include it first:
#ifdef BOOST_USER_CONFIG
# include BOOST_USER_CONFIG
#endif

// if we don't have a compiler config set, try and find one:
#if !defined(BOOST_COMPILER_CONFIG) && !defined(BOOST_NO_COMPILER_CONFIG) && !defined(BOOST_NO_CONFIG)
# include <boost/config/detail/select_compiler_config.hpp>
#endif
// if we have a compiler config, include it now:
#ifdef BOOST_COMPILER_CONFIG
# include BOOST_COMPILER_CONFIG
#endif

// if we don't have a std library config set, try and find one:
#if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG) && defined(__cplusplus)
# include <boost/config/detail/select_stdlib_config.hpp>
#endif
// if we have a std library config, include it now:
#ifdef BOOST_STDLIB_CONFIG
# include BOOST_STDLIB_CONFIG
#endif

// if we don't have a platform config set, try and find one:
#if !defined(BOOST_PLATFORM_CONFIG) && !defined(BOOST_NO_PLATFORM_CONFIG) && !defined(BOOST_NO_CONFIG)
# include <boost/config/detail/select_platform_config.hpp>
#endif
// if we have a platform config, include it now:
#ifdef BOOST_PLATFORM_CONFIG
# include BOOST_PLATFORM_CONFIG
#endif

// get config suffix code:
#include <boost/config/detail/suffix.hpp>

#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif

#endif // BOOST_CONFIG_HPP
27 changes: 27 additions & 0 deletions libraries/boost/include/boost/config/abi/borland_prefix.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// (C) Copyright John Maddock 2003.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

// for C++ Builder the following options effect the ABI:
//
// -b (on or off - effect emum sizes)
// -Vx (on or off - empty members)
// -Ve (on or off - empty base classes)
// -aX (alignment - 5 options).
// -pX (Calling convention - 4 options)
// -VmX (member pointer size and layout - 5 options)
// -VC (on or off, changes name mangling)
// -Vl (on or off, changes struct layout).

// In addition the following warnings are sufficiently annoying (and
// unfixable) to have them turned off by default:
//
// 8027 - functions containing [for|while] loops are not expanded inline
// 8026 - functions taking class by value arguments are not expanded inline

#pragma nopushoptwarn
# pragma option push -a8 -Vx- -Ve- -b- -pc -Vmv -VC- -Vl- -w-8027 -w-8026



12 changes: 12 additions & 0 deletions libraries/boost/include/boost/config/abi/borland_suffix.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// (C) Copyright John Maddock 2003.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

# pragma option pop
#pragma nopushoptwarn





22 changes: 22 additions & 0 deletions libraries/boost/include/boost/config/abi/msvc_prefix.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// (C) Copyright John Maddock 2003.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

//
// Boost binaries are built with the compiler's default ABI settings,
// if the user changes their default alignment in the VS IDE then their
// code will no longer be binary compatible with the bjam built binaries
// unless this header is included to force Boost code into a consistent ABI.
//
// Note that inclusion of this header is only necessary for libraries with
// separate source, header only libraries DO NOT need this as long as all
// translation units are built with the same options.
//
#if defined(_M_X64)
# pragma pack(push,16)
#else
# pragma pack(push,8)
#endif


8 changes: 8 additions & 0 deletions libraries/boost/include/boost/config/abi/msvc_suffix.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// (C) Copyright John Maddock 2003.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#pragma pack(pop)


25 changes: 25 additions & 0 deletions libraries/boost/include/boost/config/abi_prefix.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// abi_prefix header -------------------------------------------------------//

// (c) Copyright John Maddock 2003

// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).

#ifndef BOOST_CONFIG_ABI_PREFIX_HPP
# define BOOST_CONFIG_ABI_PREFIX_HPP
#else
# error double inclusion of header boost/config/abi_prefix.hpp is an error
#endif

#include <boost/config.hpp>

// this must occur after all other includes and before any code appears:
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif

#if defined( __BORLANDC__ )
#pragma nopushoptwarn
#endif

27 changes: 27 additions & 0 deletions libraries/boost/include/boost/config/abi_suffix.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// abi_sufffix header -------------------------------------------------------//

// (c) Copyright John Maddock 2003

// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).

// This header should be #included AFTER code that was preceded by a #include
// <boost/config/abi_prefix.hpp>.

#ifndef BOOST_CONFIG_ABI_PREFIX_HPP
# error Header boost/config/abi_suffix.hpp must only be used after boost/config/abi_prefix.hpp
#else
# undef BOOST_CONFIG_ABI_PREFIX_HPP
#endif

// the suffix header occurs after all of our code:
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif

#if defined( __BORLANDC__ )
#pragma nopushoptwarn
#endif


Loading

0 comments on commit 759a228

Please sign in to comment.