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 230906 #97

Closed
wants to merge 17 commits into from
Closed

Cmake 230906 #97

wants to merge 17 commits into from

Conversation

defiantnerd
Copy link
Collaborator

change the library name so the targets are easier identifiable. added some comments to explain the mechanics.

baconpaul and others added 17 commits August 30, 2023 22:03
* Rework the CMake Build System a bit

1. Don't link Steinberg CMake
2. Update macos bundle and info plist support
3. Document the various options

* Few more tweaks

* - Windows builds a bundle properly now.

* Working windows build

* iAnd Linux

* DEV/REL fixes not just on linux

* Respond to review feedback
* Multi-Build generators correct bundle

In the case where a generator has multiple release types
in one cmake directory, the win and lin bundle incorrectly
had a DEBUG or RELEASE inserted. This corrects that problem
and houses the VST3 in a debug/ or release/ directory

On macOS the built in cmake bundle extensions will handle this.

* Optionally generate folder; default to single file on win
* restructuring code segments to libraries

* WIP: entrypoint symbols missing

* continue the lib everything push. This is the compact form building
on macOS so far only

* Windows Single File defaults to True

* And now Linux too

* We no longer need nomainwq

---------

Co-authored-by: defiantnerd <[email protected]>
If (1) CMAKE_WRAPPER_BUILD_AUV2 is set and (2) we can find
the AUDIOUNIT_SDK_ROOT using the same pattern as the rest, then
build a stub AUV2.

This AUV2 isn't usable. And to complete this work will require
a bunch of information to fill out the info.plist. But it will scan
in auval and show up as an audio unit.

So commit this to 'next' as an off-by-default starting point for
AUV2
Use gulrak filesystem rather than std::filesystem by using
ifdefs and fs:: namespace alias for std::filesystem or
ghc::filesystem. Grab the gulrak filesystem from github
using CPM. Set the OS version to 10.11 - which allows AU
and VST3.

Closes #20

As a result, the VST3 no longer leaks filesystem symbols,
so also Closes #72
1. Use CPM to download the VST3, clap, and if appropriate
   AudioUnit SDK rather than having to specify a path. It's
   a tradeoff, you know? It is an off-by-default option
2. Add a CI job set which exercises it to make sure it works
3. Fix a couple of small bugs which occured when you didn't
   specify a CLAP_WRAPPER_NAME
4. Print the VST3 version no matter how you get the SDK

Closes #73
no .vst3 but .auv2 in the auv2 identifier
Vst3Parameeter::create used to do

if (info->module && info->module[0])

but clap_param_info_t defines the module a `char module[CLAP_PATH_SIZE]
so it is always a realized pointer. This made macos throw the
warning

address of array 'info->module' will always evaluate to 'true' [-Wpointer-bool-conversion]

correctly. So just fix it!
This implements linux timer and FD support, and fires the
linux onIdle loop in the VST3 host. It accomplishes this
by tapping into the Steinberg::Linux::IRunLoop which only
exists on the pluginframe. This means absent a UI you currently
don't get linux timer and fd events.  But since the primary use
of these features to date is UI updates, it makes a large number
of claps work in the vst3 wrapper in reaper and bitwig on initial
tests.

Separately from this commit, we should decide what we want to
do about FD polling and timers absent a UI, probably by
consulting with the bitwig and reaper native clap implementations.
macOS bundles support a PlugIn directory (Contents/PlugIns) which
contain subordinate plug-ins to be loaded. This commit does two things

1. Adds a MACOS_EMBEDDED_CLAP_LOCATION option to target_add_auv2/vst3_wrapper
   which if set creates the Contents/Plugins in the bundle and copys the
   plugin there; and

2. Modifies the mac system paths to look up the current running bundle
   and then use CFBundleCopyBuiltInPlugInsURL to get this location and
   pre-pend it to the clap load search path.

Result: Fully self contained VST3 and AUV2.
* For now, express the entire set of AUv2 options in cmake

This will clearly evolve, but to get the AUv2 effort started,
add the full set of identifying options to the CMake function as
requirements and add them to the info.plist when generated

* Ooops! Make the code do what the warning says the code does for
instrument type

---------

Co-authored-by: defiantnerd <[email protected]>
These changes allow the cmake functions to work at a not-top-level
and to supress the default targets so you can augment your targets
with wrapitude.

The changes mostly amount to

1. CACHE STRING vs PARENT_SCOPE. Some thing sjust need a lifetime
   beyond the parent scope when PARENT_SCOPE is not top level.
2. The functions called from anywhere mean we can't rely on
   the working directory being the current soruce, so cache
   current source and use it in a couple of key places.
3. Add an option to skip the build or activate it, with them
   on by default. I chose a "DONT ADD" rather than "ADD" flag
   here but might change it. This also pushes us to cmake 3.21 for
   PROJECT TOP LEVEL
4. Set visibilty flags for objective c as well as c++. Enable OBJC
   explicitly
5. Supress some warnings from the VST3 SDK we can't fix
6. Have the github actions show what was built
7. Make the '_selfcontained' style of linkage work on linux
8. Self-contained vst3 with in-library clap_entry works (as well
   as in-bundle plugin)
* If OSX_DEPLOYMENT target >= 10.15, use std::filesystem

The default OSX_DEPLOYMENT for this package is 10.11, but
since we can also be included and used by a parent project
which may make a different choice, if that parent project
chooses an OSX_DEPLOYMENT of 10.15 or higher, don't download
gulrak filesystem and use std::filesystem from the os libc

Closes #90

* Should not have included clang format

---------

Co-authored-by: defiantnerd <[email protected]>
@defiantnerd defiantnerd closed this Sep 6, 2023
@defiantnerd
Copy link
Collaborator Author

needs to be merged to next.

@defiantnerd defiantnerd reopened this Sep 6, 2023
@defiantnerd defiantnerd closed this Sep 6, 2023
@defiantnerd defiantnerd deleted the cmake_230906 branch September 6, 2023 07:06
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