From f34d2c3aa3047562f7ecb4174c5d513b9d6ebe74 Mon Sep 17 00:00:00 2001 From: Katalin Rebhan Date: Mon, 17 Feb 2025 18:25:40 +0100 Subject: Add -parse-as-library to Swift library targets --- docs/markdown/snippets/swift-parse-as-library.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 docs/markdown/snippets/swift-parse-as-library.md (limited to 'docs') diff --git a/docs/markdown/snippets/swift-parse-as-library.md b/docs/markdown/snippets/swift-parse-as-library.md new file mode 100644 index 000000000..5208899bc --- /dev/null +++ b/docs/markdown/snippets/swift-parse-as-library.md @@ -0,0 +1,8 @@ +## Top-level statement handling in Swift libraries + +The Swift compiler normally treats modules with a single source +file (and files named main.swift) to run top-level code at program +start. This emits a main symbol which is usually undesirable in a +library target. Meson now automatically passes the *-parse-as-library* +flag to the Swift compiler in case of single-file library targets to +disable this behavior unless the source file is called main.swift. -- cgit v1.2.3