From f5279c046bf3dedc54fc0ea081691f0e5df5d648 Mon Sep 17 00:00:00 2001 From: Boris Batkin Date: Wed, 24 Dec 2025 08:01:50 -0800 Subject: [PATCH] more paths --- include/daScript/ast/ast.h | 2 ++ src/builtin/module_builtin_dasbind.cpp | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/daScript/ast/ast.h b/include/daScript/ast/ast.h index c758c9956b..58ecbcd125 100644 --- a/include/daScript/ast/ast.h +++ b/include/daScript/ast/ast.h @@ -1552,6 +1552,8 @@ namespace das int32_t jit_size_level = 3u; // Opt level for LLVM for binary size string jit_path_to_shared_lib; // Path to libDaScript. Optional, we'll try to find it in _das_root_/lib/ if not provided. string jit_path_to_linker; // Path to linker. Optional, we'll use clang-cl from LLVM on Windows and cc otherwise. + // dll loading + vector dll_search_paths; // additional search paths for dll loading }; struct CommentReader : public ptr_ref_count { diff --git a/src/builtin/module_builtin_dasbind.cpp b/src/builtin/module_builtin_dasbind.cpp index 4b2cc23291..f127cbc33e 100644 --- a/src/builtin/module_builtin_dasbind.cpp +++ b/src/builtin/module_builtin_dasbind.cpp @@ -219,7 +219,20 @@ FastCallWrapper getExtraWrapper ( int nargs, int res, int perm ) { if ( !libhandle ) { libhandle = loadDynamicLibrary(library.c_str()); if (!libhandle) { - libhandle = loadDynamicLibrary((getDasRoot() + "/" + library).c_str()); + if ( *daScriptEnvironment::bound && (*daScriptEnvironment::bound)->g_Program ) { + for ( auto & root : (*daScriptEnvironment::bound)->g_Program->policies.dll_search_paths ) { + libhandle = loadDynamicLibrary((root + "/" + library).c_str()); + if ( libhandle ) break; + } + /* // we figure this out later + if ( !libhandle ) { + libhandle = loadDynamicLibrary(((*daScriptEnvironment::bound)->g_Program->policies.jit_path_to_shared_lib + "/" + library).c_str()); + } + */ + } + if ( !libhandle ) { + libhandle = loadDynamicLibrary((getDasRoot() + "/" + library).c_str()); + } } } g_dasBindLib[library] = libhandle;