diff options
author | chitranjali <chitranjali189@gmail.com> | 2018-03-23 22:18:27 +0530 |
---|---|---|
committer | chitranjali <chitranjali189@gmail.com> | 2018-03-29 13:32:36 +0530 |
commit | 34cb503c854e9afe2f3e13e9d4a5788c47b830a9 (patch) | |
tree | bce771ea5d9252b9c701d54ad4b56066ca1d8194 | |
parent | 83766313a71e79fd81bc6d89cabdb21f90fc3251 (diff) | |
download | meson-34cb503c854e9afe2f3e13e9d4a5788c47b830a9.zip meson-34cb503c854e9afe2f3e13e9d4a5788c47b830a9.tar.gz meson-34cb503c854e9afe2f3e13e9d4a5788c47b830a9.tar.bz2 |
PR review changes closes #2865
-rw-r--r-- | mesonbuild/build.py | 4 | ||||
-rwxr-xr-x | run_unittests.py | 11 | ||||
-rw-r--r-- | test cases/unit/25 shared_mod linking/installed_files.txt | 1 | ||||
-rw-r--r-- | test cases/unit/25 shared_mod linking/meson.build | 5 |
4 files changed, 10 insertions, 11 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index fac0c42..d6b737e 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -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): diff --git a/run_unittests.py b/run_unittests.py index 65ededf..cf60c11 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -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') diff --git a/test cases/unit/25 shared_mod linking/installed_files.txt b/test cases/unit/25 shared_mod linking/installed_files.txt deleted file mode 100644 index c7dab9f..0000000 --- a/test cases/unit/25 shared_mod linking/installed_files.txt +++ /dev/null @@ -1 +0,0 @@ -usr/bin/prog?exe diff --git a/test cases/unit/25 shared_mod linking/meson.build b/test cases/unit/25 shared_mod linking/meson.build index d8934e9..2df16fc 100644 --- a/test cases/unit/25 shared_mod linking/meson.build +++ b/test cases/unit/25 shared_mod linking/meson.build @@ -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)
\ No newline at end of file |