From 3d278547fec14ae76e3f497fc78c9e5be7ebedc0 Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Sat, 29 Apr 2023 21:24:14 +0200 Subject: [PATCH] vapoursynth: Add Mac support --- .github/workflows/ci.yml | 4 ++-- src/vapoursynth_wrap.cpp | 10 +++++++--- src/vapoursynth_wrap.h | 3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f8e10507..7cf4dbc6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,13 +53,13 @@ jobs: name: macOS Debug, os: macos-latest, buildtype: debugoptimized, - args: -Ddefault_library=static -Dbuild_osx_bundle=true -Dlocal_boost=true + args: -Ddefault_library=static -Dbuild_osx_bundle=true -Dlocal_boost=true -Dvapoursynth=enabled } - { name: macOS Release, os: macos-latest, buildtype: release, - args: -Ddefault_library=static -Dbuild_osx_bundle=true -Dlocal_boost=true + args: -Ddefault_library=static -Dbuild_osx_bundle=true -Dlocal_boost=true -Dvapoursynth=enabled } steps: diff --git a/src/vapoursynth_wrap.cpp b/src/vapoursynth_wrap.cpp index f9f64add9..8bbbccbbf 100644 --- a/src/vapoursynth_wrap.cpp +++ b/src/vapoursynth_wrap.cpp @@ -26,8 +26,6 @@ #include "options.h" -#include - #ifndef _WIN32 #include #endif @@ -35,7 +33,13 @@ #ifdef _WIN32 #define VSSCRIPT_SO "vsscript.dll" #else +#ifdef __APPLE__ +#define VSSCRIPT_SO "libvapoursynth-script.dylib" +#define DLOPEN_FLAGS RTLD_LAZY | RTLD_GLOBAL +#else #define VSSCRIPT_SO "libvapoursynth-script.so" +#define DLOPEN_FLAGS RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND +#endif #endif // Allocate storage for and initialise static members @@ -63,7 +67,7 @@ VapourSynthWrapper::VapourSynthWrapper() { #undef _Lstr #undef CONCATENATE #else - hLib = dlopen(VSSCRIPT_SO, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND); + hLib = dlopen(VSSCRIPT_SO, DLOPEN_FLAGS); #endif if (!hLib) diff --git a/src/vapoursynth_wrap.h b/src/vapoursynth_wrap.h index ee07235ff..2d663e7c5 100644 --- a/src/vapoursynth_wrap.h +++ b/src/vapoursynth_wrap.h @@ -21,13 +21,14 @@ #ifdef WITH_VAPOURSYNTH +#include + #include DEFINE_EXCEPTION(VapourSynthError, agi::Exception); struct VSAPI; struct VSSCRIPTAPI; -namespace std { class mutex; } class VapourSynthWrapper { VapourSynthWrapper(VapourSynthWrapper const&);