alien.inline.compile: write library files to resource:alien-inline-libs
parent
e56617cc05
commit
e0c0399d24
|
@ -8,6 +8,12 @@ IN: alien.inline.compiler
|
||||||
SYMBOL: C
|
SYMBOL: C
|
||||||
SYMBOL: C++
|
SYMBOL: C++
|
||||||
|
|
||||||
|
: inline-libs-directory ( -- path )
|
||||||
|
"resource:alien-inline-libs" 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" ] }
|
||||||
|
@ -17,9 +23,9 @@ SYMBOL: C++
|
||||||
|
|
||||||
: library-path ( str -- str' )
|
: library-path ( str -- str' )
|
||||||
'[
|
'[
|
||||||
"lib-" % current-vocab name>> %
|
"lib" % current-vocab name>> %
|
||||||
"-" % _ % library-suffix %
|
"-" % _ % library-suffix %
|
||||||
] "" make temp-file ;
|
] "" make inline-library-file ;
|
||||||
|
|
||||||
: src-suffix ( lang -- str )
|
: src-suffix ( lang -- str )
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,7 +60,7 @@ PRIVATE>
|
||||||
concat make-function ;
|
concat make-function ;
|
||||||
|
|
||||||
: 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