diff options
author | Katalin Rebhan <me@dblsaiko.net> | 2025-02-17 18:25:40 +0100 |
---|---|---|
committer | Jussi Pakkanen <jussi.pakkanen@mailbox.org> | 2025-07-24 13:54:53 +0300 |
commit | f34d2c3aa3047562f7ecb4174c5d513b9d6ebe74 (patch) | |
tree | 05ed2151baa5b34863ceb0848cacc161e75e5169 /docs/markdown/snippets | |
parent | c07eb44c2b54025a98162e0ccd4c70c0f9b2d244 (diff) | |
download | meson-f34d2c3aa3047562f7ecb4174c5d513b9d6ebe74.zip meson-f34d2c3aa3047562f7ecb4174c5d513b9d6ebe74.tar.gz meson-f34d2c3aa3047562f7ecb4174c5d513b9d6ebe74.tar.bz2 |
Add -parse-as-library to Swift library targets
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r-- | docs/markdown/snippets/swift-parse-as-library.md | 8 |
1 files changed, 8 insertions, 0 deletions
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 0000000..5208899 --- /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. |