summaryrefslogtreecommitdiff
path: root/test cases/unit
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2021-11-24 17:29:06 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2021-11-24 23:18:53 +0530
commitaf5993fffd37944a15326cb9510775b269352ce0 (patch)
tree7783fbd8d21a98a70497a9b3e35bffcc85b43b07 /test cases/unit
parentbd9d9818711eaba18b774e17c9ce405c5020c6f9 (diff)
downloadmeson-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/unit')
-rw-r--r--test cases/unit/1 soname/main.c5
-rw-r--r--test cases/unit/1 soname/meson.build13
2 files changed, 18 insertions, 0 deletions
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)