Skip to content

Commit 0981ac4

Browse files
committed
wip
1 parent 3e72675 commit 0981ac4

File tree

5 files changed

+286
-0
lines changed

5 files changed

+286
-0
lines changed

Examples/BuildSystems/Bazel/.bazelrc

Whitespace-only changes.

Examples/BuildSystems/Bazel/BUILD

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
load("@rules_swift//swift:swift_binary.bzl", "swift_binary")
2+
3+
# FIXME: on macos $(swiftly use --print-location)/Info.plist BundleID -> --action_env=TOOLCHAINS=<>
4+
5+
swift_binary(
6+
name = "cli",
7+
srcs = ["CLI.swift"],
8+
copts = [
9+
"-enable-experimental-feature", "Embedded",
10+
"-whole-module-optimization",
11+
],
12+
)

Examples/BuildSystems/Bazel/CLI.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#if !hasFeature(Embedded)
2+
#error("This code should only be compiled when the Embedded feature is enabled.")
3+
#endif
4+
5+
@main
6+
struct Application {
7+
static func main() {
8+
print("Hello from CLI.swift")
9+
}
10+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bazel_dep(name = "rules_swift", version = "2.8.1", repo_name = "rules_swift")

0 commit comments

Comments
 (0)