Make BestSourceException and derivatives visible to linked modules.#115
Make BestSourceException and derivatives visible to linked modules.#115JustinTArthur wants to merge 3 commits intovapoursynth:masterfrom
Conversation
meson.build
Outdated
| ) | ||
|
|
||
| libs = [] | ||
| api_args = ['-DBSSHARED_API_BUILDING'] |
There was a problem hiding this comment.
Should this be behind a check for default_library != 'static'? Though I guess even that wouldn't cover all cases.
As far as I can see, the relevant cases are:
- We're building a
libbestsource.dll(vapoursynth plugin or not): We want to export the exception types. - We're building another executable or library that will dynamically link bestsource: We want to import the exception types.
The above two cases are covered by this code. However:
- We're building a dynamic library that statically links bestsource: Here it depends on how that library calls bestsource. If it catches all of its exceptions and rethrows none of them, then the exception types don't need to be exported (though it probably doesn't hurt to export them either). If it doesn't catch all of its exception or rethrows some of them, the exception types do need to be reexported. But either way, only the exception types should be reexported, and none of bestsource's other API functions.
So, I think this current logic works, but only if BSSHARED_API_EXPORT is only applied to the exceptions and not to any of bestsource's other API functions. (Which I guess results in this comment having net zero information, but I wanted to bring this up for posterity and/or see if I missed something)
There was a problem hiding this comment.
Sure, I only export the exceptions. In case it's important, I've gone ahead and added a gate against visibility in a static build.
|
I never even intended for this to be compiled as a separate library and only imagined people dropping in the files when writing it. No idea if this is the best solution since I rarely poke this kind of C++ details |
|
I have reunited them as a single library now. |
|
The switch to monolithic plugin libs in a4c240b resolves the bug this PR was intended to fix. Closing. |
Keeping these hidden can cause the VapourSynth plugin to try to catch a made-up version of the exception classes instead of the ones actually used by libbestsource. See https://gcc.gnu.org/wiki/Visibility#Problems_with_C.2B-.2B-_exceptions_.28please_read.21.29
Fixes #114.