Files
codeql/swift/tools/prebuilt/BUILD.swift-prebuilt.bazel
Paolo Tranquilli c2be267feb Swift: enable dynamic mode
Providing `--dynamic_mode=fully` (for example setting it in
`local.bazelrc`) will now work.

All runfiles are now copied in the extractor pack: in dynamic mode,
those will be the executable and the dynamic libraries, while in static
mode only the executable will be part of the runfiles.

Setting the correct `LD_LIBRARY_PATH` in `qltest.sh` then allows to
run tests with this pakcage. If we need something more, we can switch to
a wrapper script in place of `extractor` in the future.

Notice that `LD_LIBRARY_PATH` is also set in static mode, but that has
no consequence.
2022-05-03 12:33:24 +02:00

40 lines
902 B
Plaintext

load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
cc_library(
name = "swift-llvm-support",
srcs = [
"libCodeQLSwiftFrontendTool.a",
] + select({
"@platforms//os:linux": [
"libCodeQLSwiftFrontendTool.so",
],
"@platforms//os:macos": [
"libCodeQLSwiftFrontendTool.dylib",
],
}),
hdrs = glob(["include/**/*"]),
linkopts = [
"-lm",
"-lz",
] + select({
"@platforms//os:linux": [
"-luuid",
"-lrt",
"-lpthread",
"-ldl",
],
"//conditions:default": [],
}),
strip_include_prefix = "include",
visibility = ["//visibility:public"],
)
pkg_files(
name = "swift-test-sdk",
srcs = glob([
"sdk/**/*",
]),
strip_prefix = strip_prefix.from_pkg(),
visibility = ["//visibility:public"],
)