Skip to content

Commit

Permalink
Handle case where env variable empty for make get_language_for_buildfile
Browse files Browse the repository at this point in the history
Add missing aliases for gnu-ld linker
  • Loading branch information
langmm committed May 23, 2024
1 parent de63130 commit ba54193
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion yggdrasil/drivers/CModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class LDLinker(LinkerBase):
class GCCLinker(LDLinker):
r"""Interface class for gcc linker (calls to ld)."""
toolname = GCCCompiler.toolname
aliases = GCCCompiler.aliases
aliases = GCCCompiler.aliases + ['gnu-ld']
languages = GCCCompiler.languages
platforms = GCCCompiler.platforms
default_executable = GCCCompiler.default_executable
Expand Down
4 changes: 2 additions & 2 deletions yggdrasil/drivers/CPPModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def handle_standard_flag(cls, flags, skip_standard_flag=False):
class GPPCompiler(CPPCompilerBase, GCCCompiler):
r"""Interface class for G++ compiler/linker."""
toolname = 'g++'
aliases = ['gnu-c++']
aliases = ['gnu-c++', 'gnu-g++']
default_linker = 'g++'
standard_library = 'stdc++'
libraries = {}
Expand Down Expand Up @@ -163,7 +163,7 @@ def before_registration(cls):
class GPPLinker(GCCLinker):
r"""Interface class for clang++ linker (calls to ld)."""
toolname = GPPCompiler.toolname
aliases = GPPCompiler.aliases
aliases = GPPCompiler.aliases + ['gnu-ld']
languages = GPPCompiler.languages
default_executable = GPPCompiler.default_executable
toolset = GPPCompiler.toolset
Expand Down
4 changes: 4 additions & 0 deletions yggdrasil/drivers/CompiledModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4482,6 +4482,10 @@ def env_matches_tool(cls, use_sysconfig=False, env=None,
if not with_flags:
envi_full = envi_full.split(maxsplit=1)[0]
return envi_full
logger.info(f"{cls.tooltype.title()} {cls.toolname} does not "
f"match environment:"
f"\n\ttool_base = {tool_base}"
f"\n\tenvi_base = {envi_base}")
return out

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion yggdrasil/drivers/MakeModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def get_language_for_buildfile(cls, buildfile, target=None):
lines = fd.read()
ext_present = []
for lang, info in constants.COMPILER_ENV_VARS.items():
if info['exec'] in lines:
if info['exec'] and info['exec'] in lines:
ext_present.append(lang)
if ('c' in ext_present) and ('c++' in ext_present): # pragma: debug
ext_present.remove('c')
Expand Down

0 comments on commit ba54193

Please sign in to comment.