Statically link libc and libc++ to vst3 when using mingw to build#454
Statically link libc and libc++ to vst3 when using mingw to build#454shockham wants to merge 5 commits intofree-audio:nextfrom
Conversation
|
my primary question is: if using mingw to build on windows, would this also work? I notice we don't have a CI stage for that but I think the GitHub windows runners do provide mingw. |
|
Good question, in order to verify am happy to add them to the matrix for the Is there a reason why the verifier is not set to run for single file windows builds? Also noticed have added so would only impact the windows folder vst3, so will move to work with the single file build too. |
The verifier doesnt run for single file windows builds because the 3.8.0 verifier fails on non folder builds as invalid vst3s |
| if(MSVC_VST3_VALIDATOR) | ||
| set(MSVC_VALIDATOR_FLAG -DCMAKE_CXX_COMPILER="MSVC" -DCMAKE_C_COMPILER="MSVC" -G "Visual Studio 17 2022" -A x64) | ||
| endif() |
There was a problem hiding this comment.
Had some trouble getting the validator to build under MinGW, so figured using the MSVC build might be ok here?
| LIBRARY_OUTPUT_DIRECTORY_RELEASE "${v3root}/${v3root_r}/${V3_OUTPUT_NAME}.vst3/Contents/${v3arch}-win" | ||
| SUFFIX ".vst3") | ||
| SUFFIX ".vst3" | ||
| PREFIX "") |
There was a problem hiding this comment.
The validator wouldn't find the shared lib in the folder directory due to "lib" prefix being applied, so this strips that.
| #endif | ||
|
|
||
| const CLAP_EXPORT struct clap_plugin_entry clap_entry = {CLAP_VERSION, dist_entry_init, | ||
| CLAP_EXPORT extern const struct clap_plugin_entry clap_entry = {CLAP_VERSION, dist_entry_init, |
There was a problem hiding this comment.
ahh was just about to merge and i saw this change. Why the extern? this is fully defined here right? Sorry to be late seeing ghat.
There was a problem hiding this comment.
No worries! It was to fix this issue when building with MinGW on windows: https://github.com/free-audio/clap-wrapper/actions/runs/23811973893/job/69513675175#step:6:176
For some reason MinGW seems to expect it even though it is already in the clap entry header and the issue isn't present when using MinGW on linux.
The other compilers appear to be okay with it, but doesn't feel ideal.
There was a problem hiding this comment.
hm and does it work? I wonder if the problem is actually that CLAP_EXPORT shoudl not be defined as dllexport on mingw but instead as attribute("export") or some such?
There was a problem hiding this comment.
I believe it works, as passes the VST3 validation, though I have not tested in a DAW myself
When building a VST3 for Windows on Linux using MinGW the resultant plugin would not work due to the missing libraries as they were dynamically linked.
Not sure if this is the best place or way of fixing this, so welcome to suggestions or updates to the PR.