alien.inline.compile: write library files to resource:alien-inline-libs
parent
5b46a22297
commit
8281c2fb55
|
@ -2,12 +2,19 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors arrays combinators fry generalizations
|
||||
io.encodings.ascii io.files io.files.temp io.launcher kernel
|
||||
locals make sequences system vocabs.parser words ;
|
||||
locals make sequences system vocabs.parser words io.directories
|
||||
io.pathnames ;
|
||||
IN: alien.inline.compiler
|
||||
|
||||
SYMBOL: C
|
||||
SYMBOL: C++
|
||||
|
||||
: inline-libs-directory ( -- path )
|
||||
"alien-inline-libs" resource-path dup make-directories ;
|
||||
|
||||
: inline-library-file ( name -- path )
|
||||
inline-libs-directory prepend-path ;
|
||||
|
||||
: library-suffix ( -- str )
|
||||
os {
|
||||
{ [ dup macosx? ] [ drop ".dylib" ] }
|
||||
|
@ -16,10 +23,8 @@ SYMBOL: C++
|
|||
} cond ;
|
||||
|
||||
: library-path ( str -- str' )
|
||||
'[
|
||||
"lib-" % current-vocab name>> %
|
||||
"-" % _ % library-suffix %
|
||||
] "" make temp-file ;
|
||||
'[ "lib" % "-" % _ % library-suffix % ]
|
||||
"" make inline-library-file ;
|
||||
|
||||
: src-suffix ( lang -- str )
|
||||
{
|
||||
|
|
|
@ -58,7 +58,7 @@ SYMBOL: c-strings
|
|||
PRIVATE>
|
||||
|
||||
: define-c-library ( name -- )
|
||||
c-library set
|
||||
[ current-vocab name>> % "_" % % ] "" make c-library set
|
||||
V{ } clone c-strings set
|
||||
V{ } clone compiler-args set ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue