 
 : compile-library ( -- )
     library-is-c++ get [ C++ ] [ C ] if
-    compiler-args get
+    linker-args get
     c-strings get "\n" join
     c-library get compile-to-library ;
 

: define-c-library ( name -- )
    c-library-name c-library set
    V{ } clone c-strings set
    V{ } clone compiler-args set ;

: compile-c-library ( -- )
    compile-library? [ compile-library ] when

    ] dip append-function-body c-strings get push ;

: c-link-to ( str -- )
    "-l" prepend linker-args get push ;

: c-use-framework ( str -- )
    "-framework" swap linker-args get '[ _ push ] bi@ ;

: c-link-to/use-framework ( str -- )
    os macosx? [ c-use-framework ] [ c-link-to ] if ;
