Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor adding EosioChain INTERFACE library for use in add_eosio_test_executable macro and by itself. #1638

Merged
merged 5 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 59 additions & 47 deletions CMakeModules/EosioTester.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,58 +67,70 @@ 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()

add_library(EosioTester INTERFACE)

target_link_libraries(EosioTester INTERFACE
${libtester}
Boost::unit_test_framework
EosioChain
)

macro(add_eosio_test_executable test_name)
add_executable( ${test_name} ${ARGN} )
target_link_libraries( ${test_name}
${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::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
EosioTester
)

#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
116 changes: 66 additions & 50 deletions CMakeModules/EosioTesterBuild.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,61 +64,77 @@ 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_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/wasm-jit/include )


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

add_library(EosioTester INTERFACE)

target_link_libraries(EosioTester INTERFACE
${libtester}
Boost::unit_test_framework
EosioChain
)

target_include_directories(EosioTester INTERFACE
@CMAKE_SOURCE_DIR@/libraries/testing/include )

macro(add_eosio_test_executable test_name)
add_executable( ${test_name} ${ARGN} )
target_link_libraries( ${test_name}
${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::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
EosioTester
)

#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