2020-06-10 07:18:25 +03:00
|
|
|
# This file lets us share warnings and such across the project
|
|
|
|
|
2020-06-25 05:16:58 +03:00
|
|
|
load(
|
|
|
|
"@rules_haskell//haskell:defs.bzl",
|
|
|
|
"haskell_library",
|
|
|
|
"haskell_test",
|
|
|
|
)
|
|
|
|
|
2020-06-10 07:18:25 +03:00
|
|
|
STANDARD_GHC_WARNINGS = [
|
2020-06-23 16:45:10 +03:00
|
|
|
"-O0",
|
2020-06-23 19:07:47 +03:00
|
|
|
"-v1",
|
|
|
|
"-j8",
|
|
|
|
"-fdiagnostics-color=always",
|
|
|
|
"-ferror-spans",
|
2020-06-10 07:18:25 +03:00
|
|
|
"-Weverything",
|
|
|
|
"-Wno-missing-local-signatures",
|
|
|
|
"-Wno-missing-import-lists",
|
|
|
|
"-Wno-implicit-prelude",
|
|
|
|
"-Wno-safe",
|
|
|
|
"-Wno-unsafe",
|
|
|
|
"-Wno-name-shadowing",
|
|
|
|
"-Wno-monomorphism-restriction",
|
|
|
|
"-Wno-missed-specialisations",
|
|
|
|
"-Wno-all-missed-specialisations",
|
|
|
|
"-Wno-star-is-type",
|
|
|
|
"-Wno-missing-deriving-strategies",
|
|
|
|
]
|
2020-06-23 21:54:32 +03:00
|
|
|
|
|
|
|
STANDARD_EXECUTABLE_FLAGS = [
|
|
|
|
"-threaded",
|
|
|
|
]
|
2020-06-25 05:16:58 +03:00
|
|
|
|
2020-06-25 15:56:09 +03:00
|
|
|
def semantic_language_library(language, name, srcs, nodetypes = "", **kwargs):
|
|
|
|
"""Create a new library target with dependencies needed for a language-AST project."""
|
|
|
|
if nodetypes == "":
|
|
|
|
nodetypes = language
|
2020-06-25 05:16:58 +03:00
|
|
|
haskell_library(
|
|
|
|
name = name,
|
2020-06-25 17:14:42 +03:00
|
|
|
# We can't use Template Haskell to find out the location of the
|
|
|
|
# node-types.json files, but we can pass it in as a preprocessor
|
|
|
|
# directive.
|
|
|
|
compiler_flags = STANDARD_GHC_WARNINGS + [
|
|
|
|
'-DNODE_TYPES_PATH="../../../../$(rootpath //vendor:' + nodetypes + '-node-types.json)"',
|
|
|
|
],
|
2020-06-25 05:16:58 +03:00
|
|
|
srcs = srcs,
|
2020-06-25 15:56:09 +03:00
|
|
|
extra_srcs = ["//vendor:" + nodetypes + "-node-types.json"],
|
2020-06-25 05:16:58 +03:00
|
|
|
deps = [
|
2020-06-25 15:56:09 +03:00
|
|
|
"//:base",
|
2020-06-25 05:16:58 +03:00
|
|
|
"//semantic-analysis:lib",
|
|
|
|
"//semantic-ast:lib",
|
|
|
|
"//semantic-core:lib",
|
|
|
|
"//semantic-proto:lib",
|
|
|
|
"//semantic-scope-graph:lib",
|
|
|
|
"//semantic-source:lib",
|
|
|
|
"//semantic-tags:lib",
|
|
|
|
"@stackage//:aeson",
|
|
|
|
"@stackage//:algebraic-graphs",
|
2020-06-25 15:56:09 +03:00
|
|
|
"//:containers",
|
2020-06-25 05:16:58 +03:00
|
|
|
"@stackage//:fused-effects",
|
|
|
|
"@stackage//:fused-syntax",
|
|
|
|
"@stackage//:generic-lens",
|
|
|
|
"@stackage//:generic-monoid",
|
|
|
|
"@stackage//:hashable",
|
|
|
|
"@stackage//:lens",
|
|
|
|
"@stackage//:pathtype",
|
|
|
|
"@stackage//:semilattices",
|
|
|
|
"@stackage//:template-haskell",
|
|
|
|
"@stackage//:text",
|
|
|
|
"@stackage//:tree-sitter",
|
|
|
|
"@stackage//:tree-sitter-" + language,
|
|
|
|
],
|
|
|
|
)
|