summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-11-26 12:31:46 -0800
committerDylan Baker <dylan@pnwbakers.com>2019-12-02 16:39:06 -0800
commit0ae911d893485c4b4c5f90f9d6b5f820dc1f7672 (patch)
tree9a60be838a917a909f35018a4a3d5a7b2313183f
parentab5ea9e8b60f043551a2920f70d6f3a1532d5bf8 (diff)
downloadmeson-0ae911d893485c4b4c5f90f9d6b5f820dc1f7672.tar.gz
environment: Add a special error case for getting GNU link.exe
Since I spent three days banging my head against this it seems reasonable that other people might also run into this problem. It can happen if you're trying to use microsoft's link.exe, but also have the dmd bin directory at the tail of your %PATH%, among other reasons.
-rw-r--r--mesonbuild/environment.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 83c693502..4c07e5891 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -781,6 +781,11 @@ class Environment:
for_machine, [], machine=target, exelist=compiler,
prefix=comp_class.LINKER_PREFIX if use_linker_prefix else [],
version=search_version(out))
+ elif 'GNU coreutils' in o:
+ raise EnvironmentException(
+ "Found GNU link.exe instead of MSVC link.exe. This link.exe "
+ "is not a linker. You may need to reorder entries to your "
+ "%PATH% variable to resolve this.")
raise EnvironmentException('Unable to determine dynamic linker')
def _guess_nix_linker(self, compiler: typing.List[str], comp_class: typing.Type[Compiler],