diff options
| author | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-11-24 17:29:06 +0530 |
|---|---|---|
| committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2021-11-24 23:18:53 +0530 |
| commit | af5993fffd37944a15326cb9510775b269352ce0 (patch) | |
| tree | 7783fbd8d21a98a70497a9b3e35bffcc85b43b07 /docs/yaml | |
| parent | bd9d9818711eaba18b774e17c9ce405c5020c6f9 (diff) | |
| download | meson-af5993fffd37944a15326cb9510775b269352ce0.tar.gz | |
shared_module: Add soname when used as a link target
Emit a detailed deprecation warning that explains what to do instead.
Also add a unittest.
```
DEPRECATION: target prog links against shared module mymod, which is incorrect.
This will be an error in the future, so please use shared_library() for mymod instead.
If shared_module() was used for mymod because it has references to undefined symbols,
use shared_libary() with `override_options: ['b_lundef=false']` instead.
```
Fixes https://github.com/mesonbuild/meson/issues/9492
Diffstat (limited to 'docs/yaml')
| -rw-r--r-- | docs/yaml/functions/shared_library.yaml | 7 | ||||
| -rw-r--r-- | docs/yaml/functions/shared_module.yaml | 9 |
2 files changed, 9 insertions, 7 deletions
diff --git a/docs/yaml/functions/shared_library.yaml b/docs/yaml/functions/shared_library.yaml index 46e5a1cfb..15ac782ca 100644 --- a/docs/yaml/functions/shared_library.yaml +++ b/docs/yaml/functions/shared_library.yaml @@ -2,13 +2,6 @@ name: shared_library returns: lib description: Builds a shared library with the given sources. -notes: - - | - Linking to a shared module is not supported on some - platforms, notably OSX. Consider using a - [[shared_library]] instead, if you need to both - `dlopen()` and link with a library. - posargs_inherit: _build_target_base varargs_inherit: _build_target_base kwargs_inherit: _build_target_base diff --git a/docs/yaml/functions/shared_module.yaml b/docs/yaml/functions/shared_module.yaml index 8909c2f9c..ff374e763 100644 --- a/docs/yaml/functions/shared_module.yaml +++ b/docs/yaml/functions/shared_module.yaml @@ -13,6 +13,15 @@ description: | you will need to set the `export_dynamic` argument of the executable to `true`. +notes: + - | + *Linking to a shared module is deprecated, and will be an error in the future*. + It used to be allowed because it was the only way to have a shared-library-like target that + contained references to undefined symbols. However, since 0.40.0, the `override_options:` + [[build_target]] keyword argument can be used to create such a [[shared_library]], and shared + modules have other characteristics that make them incompatible with linking, such as a lack of + SONAME. Linking to shared modules also does not work on some platforms, such as on macOS / iOS. + posargs_inherit: _build_target_base varargs_inherit: _build_target_base kwargs_inherit: _build_target_base |
