PR review changes closes #2865

pull/3277/head
chitranjali 7 years ago
parent 83766313a7
commit 34cb503c85
  1. 4
      mesonbuild/build.py
  2. 11
      run_unittests.py
  3. 1
      test cases/unit/25 shared_mod linking/installed_files.txt
  4. 5
      test cases/unit/25 shared_mod linking/meson.build

@ -1034,7 +1034,9 @@ You probably should put it in link_with instead.''')
'''
for link_target in self.link_targets:
if isinstance(link_target, SharedModule):
mlog.warning('''Linking shared modules to targets is not recommended''')
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):

@ -1898,15 +1898,14 @@ int main(int argc, char **argv) {
self.assertTrue(exception_raised, 'Double locking did not raise exception.')
def test_check_module_linking(self):
'''
"""
Test that shared modules are not linked with targets(link_with:) #2865
'''
"""
tdir = os.path.join(self.unit_test_dir, '25 shared_mod linking')
out = self.init(tdir)
for expected in [
r'WARNING: Linking shared modules to targets is not recommended'
]:
self.assertRegex(out, re.escape(expected))
msg = ('''WARNING: target links against shared modules. This is not
recommended as it can lead to undefined behaviour on some platforms''')
self.assertIn(msg, out)
def test_ndebug_if_release_disabled(self):
testdir = os.path.join(self.unit_test_dir, '25 ndebug if-release')

@ -1,6 +1,5 @@
project('shared library linking test', 'c', 'cpp')
lib = shared_module('mylib',
'libfile.c' # Split to different lines before and after the comma to test parser.
, install : false) # Don't install libraries in common tests; the path is platform-specific
lib = shared_module('mylib', 'libfile.c')
exe = executable('prog', 'main.c', link_with : lib, install : true)
Loading…
Cancel
Save