Skip to content

Commit

Permalink
Added OSR debug messages
Browse files Browse the repository at this point in the history
Fix G++ regex for use on windows
Add nmake regex
  • Loading branch information
langmm committed Jun 26, 2024
1 parent 970c689 commit 254e87a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion yggdrasil/drivers/CPPModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class GPPCompiler(CPPCompilerBase, GCCCompiler):
aliases = ['gnu-c++', 'gnu-g++']
default_linker = 'g++'
version_regex = [
r'(?P<version>(?:.*gnu\-)?(?:g|c)\+\+ \(.+\) \d+\.\d+\.\d+)']
r'(?P<version>(?:.*gnu\-)?(?:g|c)\+\+(?:\.exe)? \(.+\) \d+\.\d+\.\d+)']
standard_library = 'stdc++'
libraries = {}

Expand Down
6 changes: 4 additions & 2 deletions yggdrasil/drivers/MakeModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ class NMakeBuilder(MakeBuilder):
default_flags = ['/NOLOGO']
flag_options = OrderedDict([('buildfile', '/f')])
default_executable = None
version_regex = None

version_regex = [
r'(?P<version>Microsoft \(R\) Program Maintenance Utility '
r'Version \d+\.\d+(?:\.\d+)*)']


class MakeModelDriver(BuildModelDriver):
r"""Class for running make file compiled drivers. Before running the
Expand Down
5 changes: 5 additions & 0 deletions yggdrasil/drivers/OSRModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ def compile_dependencies(cls, target='OpenSimRootYgg', toolname=None,
env['YGG_OSR_TOOL'] = toolname
if toolname == 'cl++':
cl_path = tool.get_executable(full_path=True)
link_path = tool.get_tool('linker').get_executable(
full_path=True)
logger.info(f"OSR compiler: {cl_path}\n"
f"OSR linker: {link_path}")
if cl_path:
msvc_bin = os.path.dirname(cl_path)
env['YGG_OSR_CXX'] = cl_path
Expand All @@ -184,6 +188,7 @@ def compile_dependencies(cls, target='OpenSimRootYgg', toolname=None,
env[k] = v.replace('/', '-')
env[k] = MakeModelDriver.fix_path(
v, for_env=True, is_gnu=True)
logger.info(f"OSR env {k} = {v}")
else: # pragma: debug
env.pop('YGG_OSR_TOOL')
warnings.warn(
Expand Down

0 comments on commit 254e87a

Please sign in to comment.