]> gitweb.factorcode.org Git - factor.git/commitdiff
llvm.core: use find-library.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 7 Jun 2014 22:39:06 +0000 (15:39 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 7 Jun 2014 22:39:06 +0000 (15:39 -0700)
extra/llvm/core/core.factor

index 1fafe05190a8280310ccee6907a4ec054a2dace1..35105aa3c6b6b58ca3a536c820f2ad37ff81231a 100644 (file)
@@ -1,24 +1,14 @@
 ! Copyright (C) 2009 Matthew Willis.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.libraries alien.syntax system sequences combinators kernel alien.c-types ;
+
+USING: alien alien.c-types alien.libraries
+alien.libraries.finder alien.syntax kernel sequences ;
 
 IN: llvm.core
 
 <<
-
-: add-llvm-library ( name -- )
-    dup
-    {
-        { [ os macosx? ] [ "/usr/local/lib/lib" ".dylib" surround ] }
-        { [ os windows? ] [ ".dll" append ] }
-        { [ os unix? ] [ "lib" ".so" surround ] }
-    } cond cdecl add-library ;
-
-"LLVMSystem" add-llvm-library
-"LLVMSupport" add-llvm-library
-"LLVMCore" add-llvm-library
-"LLVMBitReader" add-llvm-library
-
+{ "LLVMSystem" "LLVMSupport" "LLVMCore" "LLVMBitReader" }
+[ dup find-library cdecl add-library ] each
 >>
 
 ! llvm-c/Core.h