Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickt committed Jul 1, 2020
1 parent b034378 commit 65704c0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
37 changes: 23 additions & 14 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,28 @@ load(
"haskell_toolchain_library",
)

# You can specify what kind of compilation mode you want by providing
# --compilation_mode=MODE to `bazel build`, where MODE is one of
# 'fastbuild', 'dbg', or 'opt'. We declare targets corresponding to this
# setting, which are used in common.bzl to vary compiler flags based
# on the compilation mode. Note that you can also just write `-c opt`
# if you're not into writing out compilation_mode.

config_setting(
name = "release",
values = {"compilation_mode": "opt"},
)

config_setting(
name = "development",
values = {"compilation_mode": "fastbuild"},
)

config_setting(
name = "debug",
values = {"compilation_mode": "dbg"},
)

# The GHC bindists provide us with a set of builtin libraries.
# We use them rather than looking up those in stackage.

Expand All @@ -34,20 +56,7 @@ haskell_toolchain_library(name = "template-haskell")

haskell_toolchain_library(name = "transformers")

config_setting(
name = "release",
values = {"compilation_mode": "opt"},
)

config_setting(
name = "development",
values = {"compilation_mode": "fastbuild"},
)

config_setting(
name = "debug",
values = {"compilation_mode": "dbg"},
)
# This repl target is used by hie-bios + ghcide.

haskell_repl(
name = "hie-bios",
Expand Down
2 changes: 1 addition & 1 deletion docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The first time you run `bazel build`, it'll take some time, as Bazel will compil
| Build/run executable | `cabal run semantic -- ARGS` | `bazel run //semantic:exe -- ARGS` |
| Load REPL component | `script/ghci` and `:load` | `bazel build //TARGET@repl` |
| Run tests | `cabal test all` | `bazel test //...` |
| Build with optimizations | `cabal build --flags="+release"` | `bazel build -copt //...` |
| Build with optimizations | `cabal build --flags="+release"` | `bazel build -c opt //...` |

## Adding a new dependency

Expand Down

0 comments on commit 65704c0

Please sign in to comment.