mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Swift: Build incompatible OS diagnostic on all platforms.
This commit is contained in:
@@ -85,12 +85,12 @@ pkg_filegroup(
|
||||
":swift-test-sdk-arch",
|
||||
":resource-dir-arch",
|
||||
] + select({
|
||||
"@platforms//os:linux": [
|
||||
":incompatible-os",
|
||||
],
|
||||
"@platforms//os:macos": [
|
||||
":xcode-autobuilder",
|
||||
],
|
||||
"//conditions:default": [
|
||||
":incompatible-os",
|
||||
],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
#include <filesystem>
|
||||
#include <stdlib.h>
|
||||
#include <optional>
|
||||
#ifdef _WIN32
|
||||
#include <process.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "absl/strings/str_cat.h"
|
||||
|
||||
#define LEVEL_REGEX_PATTERN "trace|debug|info|warning|error|critical|no_logs"
|
||||
|
||||
@@ -10,11 +10,13 @@ def _wrap_cc(rule, kwargs):
|
||||
# temporary, before we do universal merging
|
||||
"-universal_binaries",
|
||||
])
|
||||
_add_args(kwargs, "target_compatible_with", select({
|
||||
"@platforms//os:linux": [],
|
||||
"@platforms//os:macos": [],
|
||||
"//conditions:default": ["@platforms//:incompatible"],
|
||||
}))
|
||||
if "target_compatible_with" not in kwargs:
|
||||
# Restrict to Linux or macOS by default, but allow overriding
|
||||
_add_args(kwargs, "target_compatible_with", select({
|
||||
"@platforms//os:linux": [],
|
||||
"@platforms//os:macos": [],
|
||||
"//conditions:default": ["@platforms//:incompatible"],
|
||||
}))
|
||||
rule(**kwargs)
|
||||
|
||||
def swift_cc_binary(**kwargs):
|
||||
|
||||
@@ -7,4 +7,6 @@ swift_cc_binary(
|
||||
deps = [
|
||||
"//swift/logging",
|
||||
],
|
||||
# No restrictions (Windows allowed)
|
||||
target_compatible_with = [],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user