diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2019-05-15 08:33:21 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-05-16 23:05:49 +0300 |
commit | 7ce9e56a4b7186d672611c43393e777bb3c479fc (patch) | |
tree | 215781b5ce78ecb34f3403ed47d8512202321ab7 /run_unittests.py | |
parent | 61750494f5ce7bd50d6856c36537cb7e8f5a7921 (diff) | |
download | meson-7ce9e56a4b7186d672611c43393e777bb3c479fc.zip meson-7ce9e56a4b7186d672611c43393e777bb3c479fc.tar.gz meson-7ce9e56a4b7186d672611c43393e777bb3c479fc.tar.bz2 |
Fix path splitting in get_compiler_dirs() with GCC/clang on Windows
It was using ':' as a path separator while GCC uses ';' resulting in bogus
paths being returned. Instead assume that the compiler uses the platform native
separator.
The previous splitting code still worked sometimes because splitting
"C:/foo;C:/bar" resulted in the last part "/bar" being valid if "<DriveOfCWD>:/bar"
existed.
The fix also exposes a clang Windows bug where it uses the wrong separator:
https://reviews.llvm.org/D61121 . Use a regex to fix those first.
This resulted in linker errors when statically linking against a library which
had an external dependency linking against system libs.
Fixes #5386
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 6efd3c3..d64e60e 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1587,6 +1587,14 @@ class AllPlatformTests(BasePlatformTests): self.assertEqual(value, expected[args][name]) self.wipe() + def test_clike_get_library_dirs(self): + env = get_fake_env() + cc = env.detect_c_compiler(False) + for d in cc.get_library_dirs(env): + self.assertTrue(os.path.exists(d)) + self.assertTrue(os.path.isdir(d)) + self.assertTrue(os.path.isabs(d)) + def test_static_library_overwrite(self): ''' Tests that static libraries are never appended to, always overwritten. |