kiss main find libs relative to kiss

This commit is contained in:
2025-02-02 17:39:35 -06:00
parent 247b32838d
commit 95f9d93069

View File

@@ -30,7 +30,19 @@ class Main {
static function libPath(lib:String) {
#if macro
return Helpers.libPath(lib);
try {
return Helpers.libPath(lib);
} catch (e) {
// The library isn't in the classpaths but it might be in the same folder
// as kiss.
var kissPath = Helpers.libPath("kiss");
var failureMessage = "Can't find libPath for " + lib + " relative to " + kissPath;
if (FileSystem.isDirectory('${kissPath.directory()}/${lib}')) {
return '${kissPath.directory()}/${lib}';
} else {
throw failureMessage;
}
}
#end
throw 'Tried to get libPath outside of macroMain()';
return "";