daml/3rdparty/haskell/BUILD.ghc-lib-parser

97 lines
2.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

load("@io_tweag_rules_haskell//haskell:haskell.bzl", "haskell_library")
load("@ai_formation_hazel//tools:mangling.bzl", "hazel_library", "hazel_cbits")
load("@os_info//:os_info.bzl", "is_windows")
haskell_library(
name = "lib",
visibility = ["//visibility:public"],
srcs = glob(
["**/*.hs", "**/*.hsc", "**/*.hs-boot"],
exclude = ["**/GHCConstants*","**/includes/CodeGen.Platform.hs"],
),
extra_srcs = glob([
"**/*.hs-incl",
"**/Parser.hs",
"**/Lexer.hs",
"**/*ghc-lib/generated/*.h",
"includes/**/*.h",
]),
deps = [
hazel_library("base"),
hazel_library("bytestring"),
hazel_library("ghc-prim"),
hazel_library("containers"),
hazel_library("binary"),
hazel_library("filepath"),
hazel_library("directory"),
hazel_library("array"),
hazel_library("deepseq"),
hazel_library("pretty"),
hazel_library("time"),
hazel_library("transformers"),
hazel_library("process"),
hazel_library("hpc"),
"ghc-lib-parser-cbits"
] + ([hazel_library("Win32")] if is_windows else ["@libffi_nix//:ffi", hazel_library("unix")]),
compiler_flags = [
"-XHaskell2010",
"-XNoImplicitPrelude",
"-fobject-code",
"-package=ghc-boot-th",
"-package=Cabal",
"-optc-DTHREADED_RTS",
"-w",
"-Wwarn",
"-optP-DSTAGE=2",
"-optP-DTHREADED_RTS",
"-optP-DGHCI",
"-optP-DGHC_IN_GHCI",
"-I/ghc-lib/generated",
"-I/ghc-lib/stage0/compiler/build",
"-I/ghc-lib/stage1/compiler/build",
"-I/compiler", "-I/compiler/utils"
],
package_name = "ghc-lib-parser",
version = "8.8.0.20190704-selective-optimizations-off",
)
cc_library(
name = "ghc-lib-parser-cbits",
visibility = ["//visibility:public"],
deps = ["@haskell_rts//:lib"] + ([hazel_library("Win32")] if is_windows else ["@libffi_nix//:ffi", hazel_cbits("unix"), hazel_library("unix")]) + [
hazel_cbits("ghc-prim"),
hazel_cbits("base"),
hazel_cbits("containers"),
hazel_cbits("bytestring"),
hazel_cbits("binary"),
hazel_cbits("filepath"),
hazel_cbits("directory"),
hazel_cbits("array"),
hazel_cbits("deepseq"),
hazel_cbits("pretty"),
hazel_cbits("time"),
hazel_cbits("transformers"),
hazel_cbits("process"),
hazel_cbits("hpc"),
],
defines = ["THREADED_RTS"],
includes = [
"ghc-lib/generated",
"ghc-lib/stage0/compiler/build",
"ghc-lib/stage1/compiler/build",
"compiler",
"compiler/utils"
],
copts = ["-D__GLASGOW_HASKELL__=806", "-w"],
srcs = [":compiler/cbits/genSym.c", ":compiler/parser/cutils.c"],
# NOTE(MK) Without linkstatic=True hie-core falls over probably
# due to Bazel underlinking the dynamic library which GHC doesnt like.
linkstatic = True,
textual_hdrs = glob([
"**/*.h",
"**/GHCConstant*.hs",
"**/CodeGen.Platform.hs",
"**/*.hs-incl",
]),
)