DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit e9f41ad9979d35d7f747ec25652e5ff25da8e853
parent f56d13280baee304ebcb6eb92aaaa0409f8674a9
Author: falkTX <falktx@falktx.com>
Date:   Mon, 31 Jan 2022 19:32:29 +0000

Fix lv2 ttl generation for static builds

Signed-off-by: falkTX <falktx@falktx.com>

Diffstat:
Mdistrho/src/DistrhoPluginLV2export.cpp | 16+++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/distrho/src/DistrhoPluginLV2export.cpp b/distrho/src/DistrhoPluginLV2export.cpp @@ -42,6 +42,10 @@ # include "mod-license.h" #endif +#ifndef DISTRHO_OS_WINDOWS +# include <unistd.h> +#endif + #include <fstream> #include <iostream> @@ -225,7 +229,17 @@ void lv2_generate_ttl(const char* const basename) USE_NAMESPACE_DISTRHO String bundlePath(getBinaryFilename()); - bundlePath.truncate(bundlePath.rfind(DISTRHO_OS_SEP)); + if (bundlePath.isNotEmpty()) + { + bundlePath.truncate(bundlePath.rfind(DISTRHO_OS_SEP)); + } +#ifndef DISTRHO_OS_WINDOWS + else if (char* const cwd = ::getcwd(nullptr, 0)) + { + bundlePath = cwd; + std::free(cwd); + } +#endif d_nextBundlePath = bundlePath.buffer(); // Dummy plugin to get data from