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

Support Sf2 Player, Mallets, PortAudio, and Lame with MSVC #6507

Merged
merged 14 commits into from
Sep 19, 2022

Conversation

DomClark
Copy link
Member

@DomClark DomClark commented Sep 9, 2022

As in #6132, this is done by modifying the CMake code to consume these as imported targets, which can come either from vcpkg or from our own find modules. The FluidSynth port in vcpkg doesn't come with CMake support, but I have written a find module that produces an imported target anyway, as this is the preferred modern approach.

Changes:

  • Added a find module for FluidSynth.
  • Modified the find modules for STK, PortAudio, and LAME to create imported targets, first checking whether config mode produces such a target already.
  • Moved the config mode preference logic for SDL2 from the root CMakeLists.txt to the find module, for consistency with the others. I feel this is better than cluttering the list file with logic related to finding packages, which is the whole point of find modules.
  • Cleaned up the SDL2 find module since I was working on it anyway. I've removed all the unused bits, and modernised the code style.
  • Set the sndio status for Windows builds to our standard unsupported platform message; previously it was blank, unlike all of the other optional feature statuses.
  • Introduced a helper function for finding the appropriate static (import) libraries in vcpkg for different build types. This is useful when CMake integration is not provided. I used it for FluidSynth, but it could be useful for FFmpeg, for example.
  • Added specific search hints for MinGW to SDL2. The config mode script for SDL2 on MinGW doesn't provide a target, but does offer directories to look in. We might as well take advantage of those.
  • Set the host triplet for vcpkg to match the target triplet. Building FluidSynth requires building a code generation tool to generate some headers, and that tool shares a number of dependencies with FluidSynth. Matching the host and target triplets means only one version of these dependencies needs to be built, which cuts down the build time significantly.
  • Set CMAKE_NO_SYSTEM_FROM_IMPORTED for MinGW builds. Some headers of libstdc++ are sensitive to the include search order, which can be changed by specifying system headers. Treating imported target headers as standard includes avoids modifying the order inadvertently.

I think this only leaves the LADSPA plugins, ZynAddSubFx, and Gig Player missing from MSVC builds now.

CMakeLists.txt Show resolved Hide resolved
cmake/modules/FindSDL2.cmake Show resolved Hide resolved
@DomClark DomClark merged commit 5bfd7fb into LMMS:master Sep 19, 2022
@DomClark DomClark deleted the more-msvc-plugins branch September 19, 2022 19:16
@PhysSong PhysSong mentioned this pull request Jan 2, 2023
15 tasks
sakertooth pushed a commit to sakertooth/lmms that referenced this pull request May 30, 2023
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