1 ! Copyright (C) 2013 Björn Lindqvist, John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license
4 USING: alien.libraries.finder arrays combinators.short-circuit
5 environment io.backend io.files io.files.info io.pathnames kernel
6 sequences splitting system system-info.windows ;
8 IN: alien.libraries.finder.windows
12 : search-paths ( -- seq )
13 "resource:" normalize-path
15 windows-directory 3array
16 "PATH" os-env [ ";" split ] [ f ] if* append ;
18 : candidate-paths ( name -- seq )
19 search-paths over ".dll" tail? [
20 [ prepend-path ] with map
24 [ [ ".dll" append ] [ prepend-path ] bi* ] 2bi
31 M: windows find-library*
33 { [ exists? ] [ file-info regular-file? ] } 1&&