From b557d00f90452f710a6f797fbdb84b462f7bcf30 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 30 Apr 2019 16:06:37 -0700 Subject: environment: search for icl and ifort before cl and goftran Intel helpfully provides a cl.exe that is indistinguishable from Microsoft's cl.exe in output, but has the same behavior as icl.exe. Since icl and ifort will only be present in your path if you've started an Intel command prompt search for that first. --- mesonbuild/environment.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 4be412f30..962063997 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -460,12 +460,18 @@ class Environment: # List of potential compilers. if mesonlib.is_windows(): # Intel C and C++ compiler is icl on Windows, but icc and icpc elsewhere. - self.default_c = ['cl', 'cc', 'gcc', 'clang', 'clang-cl', 'pgcc', 'icl'] + # Search for icl before cl, since Intel "helpfully" provides a + # cl.exe that returns *exactly the same thing* that microsofts + # cl.exe does, and if icl is present, it's almost certainly what + # you want. + self.default_c = ['icl', 'cl', 'cc', 'gcc', 'clang', 'clang-cl', 'pgcc'] # There is currently no pgc++ for Windows, only for Mac and Linux. - self.default_cpp = ['cl', 'c++', 'g++', 'clang++', 'clang-cl', 'icl'] + self.default_cpp = ['icl', 'cl', 'c++', 'g++', 'clang++', 'clang-cl'] + self.default_fortran = ['ifort', 'gfortran', 'flang', 'pgfortran', 'g95'] else: self.default_c = ['cc', 'gcc', 'clang', 'pgcc', 'icc'] self.default_cpp = ['c++', 'g++', 'clang++', 'pgc++', 'icpc'] + self.default_fortran = ['gfortran', 'flang', 'pgfortran', 'ifort', 'g95'] if mesonlib.is_windows(): self.default_cs = ['csc', 'mcs'] else: @@ -473,7 +479,6 @@ class Environment: self.default_objc = ['cc'] self.default_objcpp = ['c++'] self.default_d = ['ldc2', 'ldc', 'gdc', 'dmd'] - self.default_fortran = ['gfortran', 'flang', 'pgfortran', 'ifort', 'g95'] self.default_java = ['javac'] self.default_cuda = ['nvcc'] self.default_rust = ['rustc'] -- cgit v1.2.3