alien.libraries.finder: adding (poorly named) ?add-library.
Runs find-library when the library was not added yet or the dll is not valid.locals-and-roots
parent
26301fd5b0
commit
da90f22b9b
|
@ -1,4 +1,5 @@
|
||||||
USING: accessors kernel sequences system vocabs ;
|
USING: accessors alien.libraries kernel sequences system vocabs
|
||||||
|
;
|
||||||
IN: alien.libraries.finder
|
IN: alien.libraries.finder
|
||||||
|
|
||||||
HOOK: find-library* os ( name -- path/f )
|
HOOK: find-library* os ( name -- path/f )
|
||||||
|
@ -6,6 +7,13 @@ HOOK: find-library* os ( name -- path/f )
|
||||||
: find-library ( name -- path/library-not-found )
|
: find-library ( name -- path/library-not-found )
|
||||||
dup find-library* [ nip ] when* ;
|
dup find-library* [ nip ] when* ;
|
||||||
|
|
||||||
|
: ?add-library ( name path abi -- )
|
||||||
|
pick lookup-library [ dll>> dll-valid? ] [ f ] if* [
|
||||||
|
3drop
|
||||||
|
] [
|
||||||
|
[ find-library ] [ add-library ] bi*
|
||||||
|
] if ;
|
||||||
|
|
||||||
! Try to find the library from a list, but if it's not found,
|
! Try to find the library from a list, but if it's not found,
|
||||||
! try to open a library that is the first name in that list anyway
|
! try to open a library that is the first name in that list anyway
|
||||||
! or "library_not_found" as a last resort for better debugging.
|
! or "library_not_found" as a last resort for better debugging.
|
||||||
|
|
Loading…
Reference in New Issue