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

fix: export targets and cmake files, add BUILD_TESTING check #18

Merged
merged 4 commits into from
Jul 23, 2023

Conversation

russkel
Copy link
Contributor

@russkel russkel commented Jul 22, 2023

I was unable to use the cmake project in my build environment because it was using non-standard variables for INSTALL paths and included cmake files. I was also unable to use the asyncio target when adding it as a dependency to my project's link_libraries.

This fixes the cmake to be more standard.

CMakeLists.txt Outdated

add_subdirectory(test)
add_subdirectory(third_party)
find_package(fmt REQUIRED)
Copy link
Owner

Choose a reason for hiding this comment

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

github ci can't find the fmt package, is this line still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I had fmt in my build environment already so I didn't need to check out the submodules.

Having a look at the code, it can be removed as a dependency from the core library quite easily as it's only called in two or three places for trivial things. Do you think this is suitable?

Copy link
Owner

Choose a reason for hiding this comment

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

I have added libfmt-dev in ci, but it reports error:

install(EXPORT "asyncioTargets" ...) includes target "asyncio" which requires target "fmt" that is not in any export set.

Copy link
Contributor Author

@russkel russkel Jul 23, 2023

Choose a reason for hiding this comment

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

Took a second to figure out what was going on there, but because this is EXPORTing the asyncio target, any dependencies to that target need to be EXPORTed as well (which we can't do for fmt as it's a dependency). CMake stuff is always annoying, the simplest fix is to use the system fmt lib (because that has been properly exported) or remove the fmt lib dep altogether as per my above suggestion.

@netcan netcan merged commit abb2fe5 into netcan:master Jul 23, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants