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
[Cmake][modules] Cleanup and utilisation of new function to link libraries #25197
Conversation
I've started reviewing this. I pulled it into my RP test builds. I appreciate that you alphabetized the dependencies. |
Any objections to merging this? Got something else in the pipeline dependant on it. |
No objections on my end. |
The macro takes an argument that is the target to link to, and then iterates over the require and optional dep lists we maintain, and then checks for a target of the form APP_NAME_LC::Dep. The goal is to remove the need to manually track/add INTERNAL_DEPS_PROP property
de1fe9d
to
61803ef
Compare
This is breaking Avahi support here The link interface of target "kodi::Avahi" contains:
Avahi::AvahiCommon
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
cmake/scripts/common/Macros.cmake:404 (find_package)
cmake/scripts/common/Macros.cmake:453 (find_package_with_ver)
CMakeLists.txt:260 (core_optional_dep) I do see Turning off the zeroconf use flag (disable avahi support) on gentoo compiles just fine. |
Description
Introduce a new function core_target_link_libraries to automatically link to a given target the optional/required dependencies when they exist.
Also start a general cleanup/consistency across modules with recent improvements to the model
Motivation and context
We have our list of optional/required deps, so instead of having each find module to manually add/track using a custom property (INTERNAL_DEPS_PROP), we just set our target names to a standard of ${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} and then use a macro to iterate over the optional and required dependency lists to do a target_link_libraries call from a given target to the dependencies.
Also some general consistency, and minor fixups. This is only about half. i'll do the rest at another point in time, as well as brining more old style modules up to this style of target use
The end goal will be to remove the INTERNAL_DEPS_PROP usage, as this allows more targetted usage.
Once all modules are using targets, we can remove the macro usage around DEP_DEFINES, DEPLIBS and SYSTEM_INCLUDES variables
How has this been tested?
Jenkins and some manual inspection of cache and build files to make sure definitions and libs are being used/linked
What is the effect on users?
N/A
Screenshots (if appropriate):
Types of change
Checklist: