mirror of
https://github.com/mesonbuild/meson.git
synced 2026-11-06 05:16:42 +00:00
compilers: Fix ifx standard arguments
ifx ignores the joined argument -stand=f08. What needs to change here is that we need to emit separate arguments. Fixes #16304
This commit is contained in:
1 parent
95cc93bbac
commit
a16910ba49
2 files changed
+28
No files matched your search
@@ -447,6 +447,11 @@ class IntelLLVMFortranCompiler(IntelLLVMLikeCompiler, IntelFortranCompiler):
|
||||
|
||||
id = 'intel-llvm'
|
||||
|
||||
def get_option_std_args(self, target: BuildTarget, subproject: T.Optional[str] = None) -> T.List[str]:
|
||||
args = super().get_option_std_args(target, subproject)
|
||||
# ifx requires the standard argument to be separate from -stand.
|
||||
return args[0].split('=', 1) if args else []
|
||||
|
||||
def get_preprocess_only_args(self) -> T.List[str]:
|
||||
return ['-EP']
|
||||
|
||||
|
||||
@@ -478,6 +478,29 @@ InstalledDir: /usr/bin'''), '14.0.0-1ubuntu1.1')
|
||||
self.assertEqual(cc.get_import_std_args(base + ['/Isome', '/Od', '/D_HAS_EXCEPTIONS']),
|
||||
['/D_HAS_EXCEPTIONS=1', '/EHsc', '/MD', '/permissive-', '/std:c++latest', '/utf-8'])
|
||||
|
||||
def test_intel_fortran_standard_args(self):
|
||||
from mesonbuild.compilers.fortran import (
|
||||
IntelFortranCompiler, IntelLLVMFortranCompiler,
|
||||
IntelClFortranCompiler, IntelLLVMClFortranCompiler,
|
||||
)
|
||||
standards = {'none': None, 'legacy': 'none', 'f95': 'f95',
|
||||
'f2003': 'f03', 'f2008': 'f08', 'f2018': 'f18'}
|
||||
for compiler_class in (IntelFortranCompiler, IntelLLVMFortranCompiler,
|
||||
IntelClFortranCompiler, IntelLLVMClFortranCompiler):
|
||||
compiler = object.__new__(compiler_class)
|
||||
for standard, value in standards.items():
|
||||
with self.subTest(compiler=compiler_class.id, standard=standard):
|
||||
if value is None:
|
||||
expected = []
|
||||
elif compiler_class is IntelLLVMFortranCompiler:
|
||||
expected = ['-stand', value]
|
||||
elif compiler_class is IntelFortranCompiler:
|
||||
expected = ['-stand=' + value]
|
||||
else:
|
||||
expected = ['/stand:' + value]
|
||||
with mock.patch.object(compiler, 'get_compileropt_value', return_value=standard):
|
||||
self.assertEqual(compiler.get_option_std_args(None), expected)
|
||||
|
||||
def test_compiler_args_class_visualstudio(self):
|
||||
env = get_fake_env()
|
||||
linker = linkers.MSVCDynamicLinker(env, MachineChoice.HOST, [])
|
||||
|
||||
Reference in new issue
Block a user