Skip to content

Update CMakeLists.txt replace find_package with aws_use_package for aws-c-event-stream #1441

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

Closed
wants to merge 3 commits into from

Conversation

mattparks
Copy link

Issue #, if available:
When building alongside aws-c-event-stream find_package pulls in the system library instead of the in source target.

Description of changes:
This change brings over the concept of aws_use_package from aws-c-common to aws-cpp-sdk-core. I did not add any testing because with IN_SOURCE_BUILD=OFF the same fine_package behaviour is maintained.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…ws-c-event-stream

NOTE: this only works if this project is used as a submodule alongside aws-c-common, AwsFindPackage.cmake might be required to be copied into this project.
# together. Only use this on CRT libraries (including S2N), libcrypto will stay as an assumed external dependency.
#
# package_name: is the name of the package to find
# DEP_CRT_LIBS: output variable will be appended after each call to this function. You don't have to use it,
Copy link

Choose a reason for hiding this comment

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

Presumably you meant DEP_AWS_LIBS instead of DEP_CRT_LIBS, here.

Comment on lines +6 to +9
# This function handles dependency list building based on if traditional CMAKE modules via. find_package should be
# used, vs if this is an in source build via. something like git submodules and add_subdirectory.
# This is largely because CMake was not well planned out, and as a result, in-source and modules don't play well
# together. Only use this on CRT libraries (including S2N), libcrypto will stay as an assumed external dependency.
Copy link

Choose a reason for hiding this comment

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

This is rather tortured English. And, presumably there is no need to comment on whether CMake, etc. was "well planned" or not. And, it's unclear (at least to me) what you mean by "CRT libraries" (i.e., presumably you don't mean the C Language Run-Time Library or any of the analogous C++ Language ones).

How about something like:

This function handles building a list of external dependencies, taking into account whether the dependency is built as a submodule or found elsewhere on the build platform. It should be used as a replacement for find_package() in cases where the dependency might satisfied either by using an installed library or by building it as part of the build. The IN_SOURCE_BUILD option determines how the dependency will be satisfied. For dependencies which are never satisfied as part of the build (such as libcrypto), find_package() should be used instead of this function.

Copy link
Author

Choose a reason for hiding this comment

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

This file is from https://github.com/awslabs/aws-c-common/blob/master/cmake/AwsFindPackage.cmake
If you want me to update the comment I can add to this pr.

Copy link

Choose a reason for hiding this comment

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

Sorry -- Github's presentation made it look like this was a new file that you were adding, so I figured it would be best if it had better verbiage before it was merged in.

In any case, I was just making a suggestion -- I'm not an aws-sdk-cpp maintainer, so I'll defer to them on what they want.

@wps132230
Copy link
Contributor

Hi there, thank you for your pull request.
We are working with maintainers of aws-c-* to have a better approach to consume their libraries.
And one improvement is to use aws_use_package.

@KaibaLopez KaibaLopez added the pr/work-in-progress This PR is a draft and needs further work. label Aug 27, 2020
@wps132230
Copy link
Contributor

Hi @mattparks We've updated a lot in aws-cpp-sdk-core/CMakeLists.txt since 1.9.x.
And it's using aws_use_package(aws-crt-cpp) instead of aws-c-event-stream now.
Does it work in your scenario? And do you still need changes in this PR?

@jmklix
Copy link
Member

jmklix commented Apr 22, 2022

#1888

@jmklix jmklix added needs-review This issue or pull request needs review from a core team member. and removed pr/work-in-progress This PR is a draft and needs further work. labels Jan 27, 2023
@jmklix
Copy link
Member

jmklix commented Jul 18, 2023

Closing this PR. Thanks for taking the time to make this PR, but it is now outdated thanks to some changes in the build process of this sdk.

@jmklix jmklix closed this Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review This issue or pull request needs review from a core team member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants