aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 3ff68ed..aca592e 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -380,6 +380,7 @@ class BuildTarget(Target):
self.process_compilers_late()
self.validate_sources()
self.validate_cross_install(environment)
+ self.check_module_linking()
def __lt__(self, other):
return self.get_id() < other.get_id()
@@ -1027,6 +1028,15 @@ You probably should put it in link_with instead.''')
def is_linkable_target(self):
return False
+ def check_module_linking(self):
+ '''
+ Warn if shared modules are linked with target: (link_with) #2865
+ '''
+ for link_target in self.link_targets:
+ if isinstance(link_target, SharedModule):
+ mlog.warning('''target links against shared modules. This is not
+recommended as it can lead to undefined behaviour on some platforms''')
+ return
class Generator:
def __init__(self, args, kwargs):