Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
*/sdkconfig.old
*/managed_components
*/dependencies.lock
**/bazel-*
Empty file.
12 changes: 12 additions & 0 deletions Examples/BuildSystems/Bazel/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load("@rules_swift//swift:swift_binary.bzl", "swift_binary")

# FIXME: on macos $(swiftly use --print-location)/Info.plist BundleID -> --action_env=TOOLCHAINS=<>

swift_binary(
name = "cli",
srcs = ["CLI.swift"],
copts = [
"-enable-experimental-feature", "Embedded",
"-whole-module-optimization",
],
)
10 changes: 10 additions & 0 deletions Examples/BuildSystems/Bazel/CLI.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#if !hasFeature(Embedded)
#error("This code should only be compiled when the Embedded feature is enabled.")
#endif

@main
struct Application {
static func main() {
print("Hello from CLI.swift")
}
}
1 change: 1 addition & 0 deletions Examples/BuildSystems/Bazel/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bazel_dep(name = "rules_swift", version = "2.8.1", repo_name = "rules_swift")
Loading
Loading