diff options
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/Fs-module.md | 15 | ||||
-rw-r--r-- | docs/markdown/snippets/fs_suffix.md | 4 | ||||
-rw-r--r-- | docs/markdown/snippets/swift-module-name.md | 9 | ||||
-rw-r--r-- | docs/markdown/snippets/swift-parse-as-library.md | 8 |
4 files changed, 35 insertions, 1 deletions
diff --git a/docs/markdown/Fs-module.md b/docs/markdown/Fs-module.md index 7ba4832..91c706e 100644 --- a/docs/markdown/Fs-module.md +++ b/docs/markdown/Fs-module.md @@ -206,13 +206,26 @@ fs.name('foo/bar/baz.dll.a') # baz.dll.a *since 0.54.0* Returns the last component of the path, dropping the last part of the -suffix +suffix. ```meson fs.stem('foo/bar/baz.dll') # baz fs.stem('foo/bar/baz.dll.a') # baz.dll ``` +### suffix + +*since 1.9.0* + +Returns the last dot-separated portion of the final component of the path +including the dot, if any. + +```meson +fs.suffix('foo/bar/baz.dll') # .dll +fs.suffix('foo/bar/baz.dll.a') # .a +fs.suffix('foo/bar') # (empty) +``` + ### read - `read(path, encoding: 'utf-8')` *(since 0.57.0)*: return a [string](Syntax.md#strings) with the contents of the given `path`. diff --git a/docs/markdown/snippets/fs_suffix.md b/docs/markdown/snippets/fs_suffix.md new file mode 100644 index 0000000..7059008 --- /dev/null +++ b/docs/markdown/snippets/fs_suffix.md @@ -0,0 +1,4 @@ +## Added suffix function to the FS module + +The basename and stem were already available. For completeness, expose also the +suffix. diff --git a/docs/markdown/snippets/swift-module-name.md b/docs/markdown/snippets/swift-module-name.md new file mode 100644 index 0000000..689dd84 --- /dev/null +++ b/docs/markdown/snippets/swift-module-name.md @@ -0,0 +1,9 @@ +## Explicitly setting Swift module name is now supported + +It is now possible to set the Swift module name for a target via the +*swift_module_name* target kwarg, overriding the default inferred from the +target name. + +```meson +lib = library('foo', 'foo.swift', swift_module_name: 'Foo') +``` 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. |