address code review comments
This commit is contained in:
@@ -167,24 +167,18 @@ def _compiler_config_from_external(config):
|
|||||||
compiler_class = class_for_compiler_name(compiler_spec.name)
|
compiler_class = class_for_compiler_name(compiler_spec.name)
|
||||||
paths = extra_attributes.get("paths", {})
|
paths = extra_attributes.get("paths", {})
|
||||||
compiler_langs = ["cc", "cxx", "fc", "f77"]
|
compiler_langs = ["cc", "cxx", "fc", "f77"]
|
||||||
for compiler in compiler_langs:
|
for lang in compiler_langs:
|
||||||
if paths.setdefault(compiler, None):
|
if paths.setdefault(lang, None):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not prefix:
|
if not prefix:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
bindir = prefix
|
|
||||||
if os.path.basename(prefix) != "bin":
|
|
||||||
bindir = os.path.join(prefix, "bin")
|
|
||||||
|
|
||||||
# Check for files that satisfy the naming scheme for this compiler
|
# Check for files that satisfy the naming scheme for this compiler
|
||||||
for file, regexp in itertools.product(
|
bindir = os.path.join(prefix, "bin")
|
||||||
os.listdir(bindir), compiler_class.search_regexps(compiler)
|
for f, regex in itertools.product(os.listdir(bindir), compiler_class.search_regexps(lang)):
|
||||||
):
|
if regex.match(f):
|
||||||
match = regexp.match(file)
|
paths[lang] = os.path.join(bindir, f)
|
||||||
if match:
|
|
||||||
paths[compiler] = os.path.join(bindir, file)
|
|
||||||
|
|
||||||
if all(v is None for v in paths.values()):
|
if all(v is None for v in paths.values()):
|
||||||
return None
|
return None
|
||||||
@@ -209,7 +203,7 @@ def _compiler_config_from_external(config):
|
|||||||
"spec": str(compiler_spec),
|
"spec": str(compiler_spec),
|
||||||
"paths": paths,
|
"paths": paths,
|
||||||
"flags": extra_attributes.get("flags", {}),
|
"flags": extra_attributes.get("flags", {}),
|
||||||
"operating_system": operating_system,
|
"operating_system": str(operating_system),
|
||||||
"target": str(target.family),
|
"target": str(target.family),
|
||||||
"modules": config.get("modules", []),
|
"modules": config.get("modules", []),
|
||||||
"environment": extra_attributes.get("environment", {}),
|
"environment": extra_attributes.get("environment", {}),
|
||||||
|
|||||||
Reference in New Issue
Block a user