update swift package

This commit is contained in:
Paolo Tranquilli
2022-04-13 14:47:51 +02:00
parent e68172f4b0
commit 73d5691d91
2 changed files with 30 additions and 12 deletions

View File

@@ -1,15 +1,28 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
_swift_prebuilt_version = "swift-5.6-RELEASE.42271.54"
_swift_sha_map = {
"linux": "92b26fbbc45f812b0581385cc81470ab636fed9cff460052aa2173de765ddef4",
"macos-x86_64": "b24f609c7868c1709e1e552e3b394664014e6a7f1e097522db80deb359bbcd2f",
}
_swift_arch_map = {
"linux": "linux",
"macos-x86_64": "darwin_x86_64",
}
def codeql_workspace():
for arch, repo_arch, sha256 in (
("linux", "linux", "48e39228e49aa560f0c1e504c4f9d488e28278b31fedc8271ce4cf807d9f7791"),
("darwin_x86_64", "macos-x86_64", "8f1e8e9cfb4391b3fbc0b90da548a7e660f302b1a8551e6640e8a944eb377028"),
):
for repo_arch, arch in _swift_arch_map.items():
sha256 = _swift_sha_map[repo_arch]
http_archive(
name = "swift_prebuilt_%s" % arch,
url = "https://github.com/dsp-testing/codeql-swift-artifacts/releases/download/swift-5.6-RELEASE.42271.49/swift-prebuilt-%s.zip" % repo_arch,
build_file = "@ql//swift/extractor:BUILD.swift-prebuilt.bazel",
url = "https://github.com/dsp-testing/codeql-swift-artifacts/releases/download/%s/swift-prebuilt-%s.zip" % (
_swift_prebuilt_version,
repo_arch,
),
build_file = "@codeql//swift/extractor:BUILD.swift-prebuilt.bazel",
sha256 = sha256,
)

View File

@@ -1,22 +1,27 @@
cc_library(
name = "swift-llvm-support",
srcs = glob([
"libswiftAndLlvmSupportReal.a",
"libswiftAndLlvmSupportReal.so",
]),
srcs = [
"libCodeQLSwiftFrontendTool.a",
] + select({
"@platforms//os:linux": [
"libCodeQLSwiftFrontendTool.so",
],
"@platforms//os:macos": [
"libCodeQLSwiftFrontendTool.dylib",
],
}),
hdrs = glob(["include/**/*"]),
linkopts = [
"-lm",
"-lz",
] + select({
"@platforms//os:macos": ["-lcurses"],
"@platforms//os:linux": [
"-luuid",
"-lrt",
"-lpthread",
"-ltinfo",
"-ldl",
],
"//conditions:default": [],
}),
strip_include_prefix = "include",
visibility = ["//visibility:public"],