Skip to content

Commit

Permalink
Merge pull request #19310 from hpvb/fix-mingw-static-mono-linking
Browse files Browse the repository at this point in the history
Fix Mono static linking on Mingw
  • Loading branch information
akien-mga authored Jun 1, 2018
2 parents ff0d295 + f2d669f commit 8684b63
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modules/mono/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ def configure(env):

if mono_static:
lib_suffix = Environment()['LIBSUFFIX']
mono_static_lib_name = 'libmono-static-sgen'

if env.msvc:
mono_static_lib_name = 'libmono-static-sgen'
else:
mono_static_lib_name = 'libmonosgen-2.0'

if not os.path.isfile(os.path.join(mono_lib_path, mono_static_lib_name + lib_suffix)):
raise RuntimeError('Could not find static mono library in: ' + mono_lib_path)
Expand All @@ -93,7 +97,10 @@ def configure(env):
env.Append(LINKFLAGS='LIBCMT' + lib_suffix)
env.Append(LINKFLAGS='Psapi' + lib_suffix)
else:
env.Append(LIBS=mono_static_lib_name)
env.Append(LINKFLAGS=os.path.join(mono_lib_path, mono_static_lib_name + lib_suffix))

env.Append(LIBS='psapi')
env.Append(LIBS='version')
else:
mono_lib_name = find_file_in_dir(mono_lib_path, mono_lib_names, extension='.lib')

Expand Down

0 comments on commit 8684b63

Please sign in to comment.