Files
codeql/swift/extractor/BUILD.bazel
Paolo Tranquilli 03d7adb303 Swift: wrap extractor with shell script
This is in preparation for the extractor to use shared libraries
packaged alongside it.

We could probably also move the `CODEQL_EXTRACTOR_SWIFT_RUN_UNDER` logic
in it, where it would be simpler and more robust.
2022-12-13 09:07:37 +01:00

38 lines
906 B
Python

load("//swift:rules.bzl", "swift_cc_binary")
load("//misc/bazel/cmake:cmake.bzl", "generate_cmake")
load("//misc/bazel:pkg_runfiles.bzl", "pkg_runfiles")
swift_cc_binary(
name = "extractor.real",
srcs = glob([
"*.h",
"*.cpp",
]),
deps = [
"//swift/extractor/infra",
"//swift/extractor/invocation",
"//swift/extractor/remapping",
"//swift/extractor/translators",
"//swift/third_party/swift-llvm-support",
],
)
generate_cmake(
name = "cmake",
targets = [":extractor.real"],
visibility = ["//visibility:public"],
)
sh_binary(
name = "extractor",
srcs = ["extractor.sh"],
data = [":extractor.real"],
)
pkg_runfiles(
name = "pkg",
srcs = [":extractor"],
excludes = ["extractor.sh"], # script gets copied as "extractor", no need for the original .sh file
visibility = ["//swift:__pkg__"],
)