Skip to content

Clojure Compiler Options

Ben Sima edited this page Feb 23, 2016 · 1 revision

One benefit of Boot over Lein is that Boot allows setting compiler options using binding. Here is an example Boot file:

(set-env! :dependencies [[org.clojure/clojure "1.7.0"]]
          :source-paths #{"src"})

(require '[my.app.core :as m])

(def my-compiler-opts
  {:disable-locals-clearing true})

(deftask dev []
  (binding [clojure.core/*compiler-options* my-compiler-opts]
    (m/run-my-app)))

Fine-grained control of compiler options like this is not possible with Leiningen. A list of compiler options is available at Clojure.org

Clone this wiki locally