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

Conversation

oschwaldp-oci
Copy link
Contributor

@oschwaldp-oci oschwaldp-oci commented Sep 14, 2023

This refactor creates an INTERFACE library called EosioChain which can be used externally to leap as a library for target_link_libraries. In an repository that wants to depend on and link against EosioChain, it can now be done by simply:

find_package(eosio)
target_link_libraries( <myNewTarget> PRIVATE EosioChain ...)

These dependencies allow for additional use of add_eosio_test_executable outside of leap for executables loosely defined as test artifacts.  For example, compiling a transaction generator in another repository.
@oschwaldp-oci oschwaldp-oci added the OCI Work exclusive to OCI team label Sep 14, 2023
Copy link
Member

@spoonincode spoonincode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How difficult would it be to refactor this cmake file to present maybe a add_library(libtester STATIC IMPORTED). Then the existing add_eosio_test_executable would just link to the IMPORTED libtester, but when you're not making a test executable you would just target_link_libraries(whatever libtester)

Adding dependencies like this makes it difficult to know the union of all downstream dependencies when reviewing this file in the future.

@oschwaldp-oci
Copy link
Contributor Author

How difficult would it be to refactor this cmake file to present maybe a add_library(libtester STATIC IMPORTED). Then the existing add_eosio_test_executable would just link to the IMPORTED libtester, but when you're not making a test executable you would just target_link_libraries(whatever libtester)

Adding dependencies like this makes it difficult to know the union of all downstream dependencies when reviewing this file in the future.

@spoonincode -- How about going the direction of an INTERFACE library like you had also mentioned out of band earlier? Proposal: 3e22bd1

@spoonincode
Copy link
Member

Yes true, INTERFACE is considerably easier than IMPORTED in this case since we have a handful of static libraries.

@oschwaldp-oci oschwaldp-oci changed the title Add a couple boost deps to add_eosio_test_executable macro Refactor adding EosioChain INTERFACE library for use in add_eosio_test_executable macro and by itself. Sep 15, 2023
@oschwaldp-oci oschwaldp-oci merged commit 7c93130 into main Sep 18, 2023
22 checks passed
@oschwaldp-oci oschwaldp-oci deleted the update_add_eosio_test_executable_deps branch September 18, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants