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 /test cases | |
| 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 'test cases')
| -rw-r--r-- | test cases/failing/75 link with shared module on osx/test.json | 2 | ||||
| -rw-r--r-- | test cases/unit/1 soname/main.c | 5 | ||||
| -rw-r--r-- | test cases/unit/1 soname/meson.build | 13 |
3 files changed, 19 insertions, 1 deletions
diff --git a/test cases/failing/75 link with shared module on osx/test.json b/test cases/failing/75 link with shared module on osx/test.json index 7db17d8d7..81ee2aca9 100644 --- a/test cases/failing/75 link with shared module on osx/test.json +++ b/test cases/failing/75 link with shared module on osx/test.json @@ -1,7 +1,7 @@ { "stdout": [ { - "line": "test cases/failing/75 link with shared module on osx/meson.build:8:0: ERROR: target links against shared modules. This is not permitted on OSX" + "line": "test cases/failing/75 link with shared module on osx/meson.build:8:0: ERROR: target prog links against shared module mymodule. This is not permitted on OSX" } ] } diff --git a/test cases/unit/1 soname/main.c b/test cases/unit/1 soname/main.c new file mode 100644 index 000000000..f5ccbb936 --- /dev/null +++ b/test cases/unit/1 soname/main.c @@ -0,0 +1,5 @@ +int versioned_func (void); + +int main (void) { + return versioned_func(); +} diff --git a/test cases/unit/1 soname/meson.build b/test cases/unit/1 soname/meson.build index 950dadc5d..44b003a6d 100644 --- a/test cases/unit/1 soname/meson.build +++ b/test cases/unit/1 soname/meson.build @@ -20,3 +20,16 @@ shared_library('settosame', 'versioned.c', install : true, soversion : '7.8.9', version : '7.8.9') + +shared_module('some_module', 'versioned.c', + install: true) + +module1 = shared_module('linked_module1', 'versioned.c', + install: true) + +module2 = shared_module('linked_module2', 'versioned.c', + install: true) +module2_dep = declare_dependency(link_with: module2) + +executable('main1', 'main.c', link_with: module1) +executable('main2', 'main.c', dependencies: module2_dep) |
