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

[Cmake][modules] Cleanup and utilisation of new function to link libraries #25197

Merged
merged 25 commits into from May 18, 2024

Conversation

fuzzard
Copy link
Contributor

@fuzzard fuzzard commented May 11, 2024

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

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • Student submission (PR was done for educational purposes and will be treated as such)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@garbear
Copy link
Member

garbear commented May 12, 2024

I've started reviewing this. I pulled it into my RP test builds. I appreciate that you alphabetized the dependencies.

@fuzzard fuzzard changed the title [Cmake][modules] Cleanup and utilisation of new macro to link libraries [Cmake][modules] Cleanup and utilisation of new function to link libraries May 12, 2024
@fuzzard
Copy link
Contributor Author

fuzzard commented May 17, 2024

Any objections to merging this? Got something else in the pipeline dependant on it.

@garbear
Copy link
Member

garbear commented May 17, 2024

No objections on my end.

@fuzzard fuzzard force-pushed the cmake_cleanup1 branch 2 times, most recently from de1fe9d to 61803ef Compare May 18, 2024 01:16
@fuzzard fuzzard merged commit c7cbad0 into xbmc:master May 18, 2024
2 checks passed
@fuzzard fuzzard deleted the cmake_cleanup1 branch May 18, 2024 04:57
@mackal
Copy link

mackal commented May 18, 2024

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 -- Found Avahi: /usr/lib64/libavahi-client.so (found version "0.8") in the log, so I assume just at typo somewhere.

Turning off the zeroconf use flag (disable avahi support) on gentoo compiles just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants