mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
The bazel -> cmake generator is currently not capable of handling separate included generated cmake files making use of common C/C++ dependencies. To work around this limitation, a single generated cmake is now in place. Long-term, we should either: * make the cmake generator handle common dependencies gracefully, or * make the cmake generation aspect travel up `pkg_` rules `srcs` attributes so to avoid having to list the targets to be generated in the top-level `BUILD` file. Other things fixed: * removed some warning spam about redefined `BAZEL_CURRENT_REPOSITORY` * fixed the final link step, that was failing because `libswiftCore.so` was not being linked.
35 lines
895 B
Python
35 lines
895 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",
|
|
]),
|
|
visibility = ["//swift:__pkg__"],
|
|
deps = [
|
|
"//swift/extractor/config",
|
|
"//swift/extractor/infra",
|
|
"//swift/extractor/invocation",
|
|
"//swift/extractor/remapping",
|
|
"//swift/extractor/translators",
|
|
"//swift/third_party/swift-llvm-support",
|
|
"@absl//absl/strings",
|
|
],
|
|
)
|
|
|
|
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__"],
|
|
)
|