Skip to content

Making some tweaks that would make me happy as a vcpkg maintainer #382

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Honeybunch
Copy link

@Honeybunch Honeybunch commented Oct 19, 2024

I am currently working on getting steam-audio available via the vcpkg package manager (see microsoft/vcpkg#40942 ). However, I have had to make a substantial patch. In doing so I whipped up this PR which would minimize the work for a downstream maintainer like myself in the future.

  • Added an option to disable closed source dependencies (vcpkg ports are intended to be built from source)
  • Added an option to export the cmake package
  • Made CMAKE_OSX variables override-able (so you can build just an arm64 or x86_64 library)
  • Made the include directories compatible with project export
  • Only installing pdb/dbg info on shared library build (just being nice for vcpkg)

When the project is marked for export the minimal dependencies linked will be fetched via config mode so they can be tracked during the export process and the dependency chain will be properly exported. In this case the dependencies (mysofa, flatbuffers, pffft) will be found via Config mode which vcpkg or another package manager should provide via its environment.

Happy to make any changes you see fit to this. I'm not married to any of it. Also, if you don't want me to make steam-audio available on vcpkg at all let me know and I can just drop this 😄


if (STEAMAUDIO_ENABLE_EMBREE)
if (STEAMAUDIO_ENABLE_EMBREE AND STEAMAUDIO_CLOSED_SOURCE_DEPS)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note that Embree, Radeon Rays, and TrueAudio Next are not technically closed-source dependencies. They're all open source, and Embree is even available on the vcpkg registry (although only versions newer than what we use in Steam Audio at the moment). Totally fine to not enable these features when building for vcpkg, but it might be clearer to just set STEAMAUDIO_ENABLE_EMBREE etc. to OFF in the portfile.cmake.

)

# required to resolve object libraries on import
install(TARGETS core hrtf EXPORT steam-audio_exports)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to install the core and hrtf targets? Those are just object files that will eventually be put together into phonon.dll, via the phonon target. I think just the phonon target should be installed, since that's what consumers will want to link against.

# required to resolve object libraries on import
install(TARGETS core hrtf EXPORT steam-audio_exports)

install(EXPORT steam-audio_exports
Copy link
Collaborator

Choose a reason for hiding this comment

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

(See above comment.) Do we need to add phonon to the steam-audio_exports?

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.

2 participants