1
1
mirror of https://github.com/github/semantic.git synced 2024-12-12 14:45:40 +03:00
semantic/build/common.bzl

73 lines
2.2 KiB
Python
Raw Normal View History

2020-06-10 07:18:25 +03:00
# This file lets us share warnings and such across the project
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",
"-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 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
haskell_library(
name = name,
# 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)"',
],
srcs = srcs,
2020-06-25 15:56:09 +03:00
extra_srcs = ["//vendor:" + nodetypes + "-node-types.json"],
deps = [
2020-06-25 15:56:09 +03:00
"//:base",
"//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",
"@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,
],
)