mirror of
https://github.com/github/codeql.git
synced 2025-12-19 02:13:17 +01:00
This adds `cppgen`, creating structured C++ classes mirroring QL classes out of `schema.yml`. An example of generated code at the time of this commit can be found [in this gist][1]. [1]: https://gist.github.com/redsun82/57304ddb487a8aa40eaa0caa695048fa Closes https://github.com/github/codeql-c-team/issues/863
48 lines
1.1 KiB
Python
48 lines
1.1 KiB
Python
load("@swift_codegen_deps//:requirements.bzl", "requirement")
|
|
|
|
filegroup(
|
|
name = "schema",
|
|
srcs = ["schema.yml"],
|
|
visibility = ["//swift:__subpackages__"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "schema_includes",
|
|
srcs = glob(["*.dbscheme"]),
|
|
visibility = ["//swift:__subpackages__"],
|
|
)
|
|
|
|
py_binary(
|
|
name = "codegen",
|
|
srcs = glob(
|
|
["*.py"],
|
|
exclude = ["trapgen.py"],
|
|
),
|
|
visibility = ["//swift/codegen/test:__pkg__"],
|
|
deps = ["//swift/codegen/lib"],
|
|
)
|
|
|
|
# as opposed to the above, that is meant to only be run with bazel run,
|
|
# we need to be precise with data dependencies of this which is meant be run during build
|
|
py_binary(
|
|
name = "trapgen",
|
|
srcs = ["trapgen.py"],
|
|
data = ["//swift/codegen/templates:trap"],
|
|
visibility = ["//swift:__subpackages__"],
|
|
deps = [
|
|
"//swift/codegen/lib",
|
|
requirement("toposort"),
|
|
],
|
|
)
|
|
|
|
py_binary(
|
|
name = "cppgen",
|
|
srcs = ["cppgen.py"],
|
|
data = ["//swift/codegen/templates:cpp"],
|
|
visibility = ["//swift:__subpackages__"],
|
|
deps = [
|
|
"//swift/codegen/lib",
|
|
requirement("toposort"),
|
|
],
|
|
)
|