Skip to content

Commit

Permalink
cleanup; limited the scope of the parameterization
Browse files Browse the repository at this point in the history
  • Loading branch information
dyoo authored and endobson committed Feb 26, 2013
1 parent 7b440f7 commit 72d4735
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions build.rkt
Expand Up @@ -13,34 +13,35 @@
(bytes->string/utf-8 (system-type 'so-suffix))))

;; Switch the compiler to clang if we can find it.
(current-extension-compiler (cond [(find-executable-path "clang")
=> values]
[else
(current-extension-compiler)]))

;; Change the compiler flags:
(current-extension-compiler-flags
(append cxx-flags (current-extension-compiler-flags)))

;; As well as the linker flags:
(current-extension-linker-flags
(append ld-flags (current-extension-linker-flags)))


;; Finally, build:
(compile-extension #t
"llvm-racket.cpp"
"llvm-racket.o"
include-dirs)
;; ... and link:
(link-extension #t
(list "llvm-racket.o")
output-so-name)

;; cleanup:
(delete-file "llvm-racket.o")

(void))
(parameterize ([current-extension-compiler
(cond [(find-executable-path "clang")
=> values]
[else
(current-extension-compiler)])]

;; Change the compiler flags:
[current-extension-compiler-flags
(append cxx-flags (current-extension-compiler-flags))]

;; As well as the linker flags:
[current-extension-linker-flags
(append ld-flags (current-extension-linker-flags))])


;; Finally, build:
(compile-extension #t
"llvm-racket.cpp"
"llvm-racket.o"
include-dirs)
;; ... and link:
(link-extension #t
(list "llvm-racket.o")
output-so-name)

;; cleanup:
(delete-file "llvm-racket.o")

(void)))


(define (llvm-config flags)
Expand Down

0 comments on commit 72d4735

Please sign in to comment.