Skip to content

Commit

Permalink
Create EosioChain interface library.
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwaldp-oci committed Sep 15, 2023
1 parent 4b346ed commit 3e22bd1
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 97 deletions.
99 changes: 52 additions & 47 deletions CMakeModules/EosioTester.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,60 +67,65 @@ if("eos-vm-oc" IN_LIST EOSIO_WASM_RUNTIMES)
set(WRAP_MAIN "-Wl,-wrap=main")
endif()

add_library(EosioChain INTERFACE)

target_link_libraries(EosioChain INTERFACE
${libchain}
${libfc}
${libwast}
${libwasm}
${libir}
${libsoftfloat}
${liboscrypto}
${liblogging}
${libchainbase}
${libbuiltins}
${libsecp256k1}
${libbn256}
${libbls12-381}
@GMP_LIBRARY@

Boost::date_time
Boost::filesystem
Boost::system
Boost::chrono
Boost::multi_index
Boost::multiprecision
Boost::interprocess
Boost::asio
Boost::signals2
Boost::iostreams
"-lz" # Needed by Boost iostreams

${LLVM_LIBS}

${PLATFORM_SPECIFIC_LIBS}

${WRAP_MAIN}
Threads::Threads
)

target_include_directories(EosioChain INTERFACE
@OPENSSL_INCLUDE_DIR@
@CMAKE_INSTALL_PREFIX@
@CMAKE_INSTALL_FULL_INCLUDEDIR@
@CMAKE_INSTALL_FULL_INCLUDEDIR@/wasm-jit
@CMAKE_INSTALL_FULL_INCLUDEDIR@/softfloat )

#adds -ltr. Ubuntu eosio.contracts build breaks without this
if(UNIX AND NOT APPLE)
target_link_libraries(EosioChain INTERFACE ${LIBRT})
endif()

macro(add_eosio_test_executable test_name)
add_executable( ${test_name} ${ARGN} )
target_link_libraries( ${test_name}
EosioChain
${libtester}
${libchain}
${libfc}
${libwast}
${libwasm}
${libir}
${libsoftfloat}
${liboscrypto}
${liblogging}
${libchainbase}
${libbuiltins}
${libsecp256k1}
${libbn256}
${libbls12-381}
@GMP_LIBRARY@

Boost::date_time
Boost::filesystem
Boost::system
Boost::chrono
Boost::multi_index
Boost::multiprecision
Boost::program_options
Boost::beast
Boost::interprocess
Boost::asio
Boost::signals2
Boost::iostreams
"-lz" # Needed by Boost iostreams
Boost::unit_test_framework

${LLVM_LIBS}

${PLATFORM_SPECIFIC_LIBS}

${WRAP_MAIN}
Threads::Threads
Boost::unit_test_framework
)

#adds -ltr. Ubuntu eosio.contracts build breaks without this
if(UNIX AND NOT APPLE)
target_link_libraries(${test_name} ${LIBRT})
endif()

target_include_directories( ${test_name} PUBLIC
@OPENSSL_INCLUDE_DIR@
@CMAKE_INSTALL_PREFIX@
@CMAKE_INSTALL_FULL_INCLUDEDIR@
@CMAKE_INSTALL_FULL_INCLUDEDIR@/wasm-jit
@CMAKE_INSTALL_FULL_INCLUDEDIR@/softfloat )

endmacro()

macro(add_eosio_test test_name)
Expand Down
102 changes: 52 additions & 50 deletions CMakeModules/EosioTesterBuild.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,63 +64,65 @@ if("eos-vm-oc" IN_LIST EOSIO_WASM_RUNTIMES)
set(WRAP_MAIN "-Wl,-wrap=main")
endif()

add_library(EosioChain INTERFACE)

target_link_libraries(EosioChain INTERFACE
${libchain}
${libfc}
${libwast}
${libwasm}
${libir}
${libsoftfloat}
${liboscrypto}
${liblogging}
${libchainbase}
${libbuiltins}
${libsecp256k1}
${libbn256}
${libbls12-381}
@GMP_LIBRARY@

Boost::date_time
Boost::filesystem
Boost::system
Boost::chrono
Boost::multi_index
Boost::multiprecision
Boost::interprocess
Boost::asio
Boost::signals2
Boost::iostreams
"-lz" # Needed by Boost iostreams

${LLVM_LIBS}

${PLATFORM_SPECIFIC_LIBS}

${WRAP_MAIN}
Threads::Threads
)

target_include_directories(EosioChain INTERFACE
@OPENSSL_INCLUDE_DIR@
@CMAKE_INSTALL_PREFIX@
@CMAKE_INSTALL_FULL_INCLUDEDIR@
@CMAKE_INSTALL_FULL_INCLUDEDIR@/wasm-jit
@CMAKE_INSTALL_FULL_INCLUDEDIR@/softfloat )

#adds -ltr. Ubuntu eosio.contracts build breaks without this
if(UNIX AND NOT APPLE)
target_link_libraries(EosioChain INTERFACE ${LIBRT})
endif()

macro(add_eosio_test_executable test_name)
add_executable( ${test_name} ${ARGN} )
target_link_libraries( ${test_name}
EosioChain
${libtester}
${libchain}
${libfc}
${libwast}
${libwasm}
${libir}
${libsoftfloat}
${liboscrypto}
${liblogging}
${libchainbase}
${libbuiltins}
${libsecp256k1}
${libbn256}
${libbls12-381}
@GMP_LIBRARY@

Boost::date_time
Boost::filesystem
Boost::system
Boost::chrono
Boost::multi_index
Boost::multiprecision
Boost::program_options
Boost::beast
Boost::interprocess
Boost::asio
Boost::signals2
Boost::iostreams
"-lz" # Needed by Boost iostreams
Boost::unit_test_framework

${LLVM_LIBS}

${PLATFORM_SPECIFIC_LIBS}

${WRAP_MAIN}
Threads::Threads
Boost::unit_test_framework
)

#adds -ltr. Ubuntu eosio.contracts build breaks without this
if(UNIX AND NOT APPLE)
target_link_libraries(${test_name} ${LIBRT})
endif()

target_include_directories( ${test_name} PUBLIC
@OPENSSL_INCLUDE_DIR@
@CMAKE_SOURCE_DIR@/libraries/chain/include
@CMAKE_BINARY_DIR@/libraries/chain/include
@CMAKE_SOURCE_DIR@/libraries/libfc/include
@CMAKE_SOURCE_DIR@/libraries/softfloat/source/include
@CMAKE_SOURCE_DIR@/libraries/appbase/include
@CMAKE_SOURCE_DIR@/libraries/chainbase/include
@CMAKE_SOURCE_DIR@/libraries/testing/include
@CMAKE_SOURCE_DIR@/libraries/wasm-jit/Include )
endmacro()

macro(add_eosio_test test_name)
Expand Down

0 comments on commit 3e22bd1

Please sign in to comment.