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.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors arrays combinators fry generalizations
|
USING: accessors arrays combinators fry generalizations
|
||||||
io.encodings.ascii io.files io.files.temp io.launcher kernel
|
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
|
IN: alien.inline.compiler
|
||||||
|
|
||||||
SYMBOL: C
|
SYMBOL: C
|
||||||
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 )
|
: library-suffix ( -- str )
|
||||||
os {
|
os {
|
||||||
{ [ dup macosx? ] [ drop ".dylib" ] }
|
{ [ dup macosx? ] [ drop ".dylib" ] }
|
||||||
|
@ -16,10 +23,8 @@ SYMBOL: C++
|
||||||
} cond ;
|
} cond ;
|
||||||
|
|
||||||
: library-path ( str -- str' )
|
: library-path ( str -- str' )
|
||||||
'[
|
'[ "lib" % "-" % _ % library-suffix % ]
|
||||||
"lib-" % current-vocab name>> %
|
"" make inline-library-file ;
|
||||||
"-" % _ % library-suffix %
|
|
||||||
] "" make temp-file ;
|
|
||||||
|
|
||||||
: src-suffix ( lang -- str )
|
: src-suffix ( lang -- str )
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,7 +58,7 @@ SYMBOL: c-strings
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: define-c-library ( name -- )
|
: define-c-library ( name -- )
|
||||||
c-library set
|
[ current-vocab name>> % "_" % % ] "" make c-library set
|
||||||
V{ } clone c-strings set
|
V{ } clone c-strings set
|
||||||
V{ } clone compiler-args set ;
|
V{ } clone compiler-args set ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue