mirror of
https://github.com/github/codeql.git
synced 2026-04-14 19:44:03 +02:00
The information that was contained in `schema.yml` is now in `swift/schema.py`, which allows a more integrated IDE experience for writing and navigating it. Another minor change is that `schema.Class` now has a `str` `group` field instead of a `pathlib.Path` `dir` one.
47 lines
1.2 KiB
Python
47 lines
1.2 KiB
Python
load("//swift:rules.bzl", "swift_cc_library")
|
|
|
|
_dirs = ("", "decl/", "expr/", "pattern/", "stmt/", "type/")
|
|
|
|
genrule(
|
|
name = "cppgen",
|
|
outs = [
|
|
"generated/swift.dbscheme",
|
|
"generated/TrapTags.h",
|
|
] + [
|
|
"generated/%s%s.%s" % (dir, name, ext)
|
|
for dir in _dirs
|
|
for name in ("TrapEntries", "TrapClasses")
|
|
for ext in ("h", "cpp")
|
|
],
|
|
cmd = " ".join([
|
|
"$(location //swift/codegen)",
|
|
"--generate=dbscheme,trap,cpp",
|
|
"--dbscheme $(RULEDIR)/generated/swift.dbscheme",
|
|
"--cpp-output $(RULEDIR)/generated",
|
|
]),
|
|
exec_tools = ["//swift/codegen"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "generated_dbscheme",
|
|
srcs = [":generated/swift.dbscheme"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
swift_cc_library(
|
|
name = "trap",
|
|
srcs = [
|
|
"generated/%s%s.cpp" % (dir, name)
|
|
for dir in _dirs
|
|
for name in ("TrapEntries", "TrapClasses")
|
|
],
|
|
hdrs = glob(["*.h"]) + [
|
|
"generated/TrapTags.h",
|
|
] + [
|
|
"generated/%s%s.h" % (dir, name)
|
|
for dir in _dirs
|
|
for name in ("TrapEntries", "TrapClasses")
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|