diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-12-22 12:31:43 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2018-12-22 12:36:19 +0100 |
commit | d52100f4ffd3191ca070be34043c5a5343cd1a0b (patch) | |
tree | 790e7c4f99e12b225fa2b5f5c1da111a205898be /modules/mono | |
parent | 404f39422665375e62863c0247768759bb2cd0be (diff) |
SCons: Allow building Mono module with OSXCross
Improve the test logic to only assume that we're building for macOS
if OSXCROSS_ROOT is defined *and* we requested p=osx.
Supersedes #24480.
Diffstat (limited to 'modules/mono')
-rw-r--r-- | modules/mono/config.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/mono/config.py b/modules/mono/config.py index 189699cca8..a81ecfce70 100644 --- a/modules/mono/config.py +++ b/modules/mono/config.py @@ -142,7 +142,9 @@ def configure(env): copy_file(mono_bin_path, 'bin', mono_dll_name + '.dll') else: - sharedlib_ext = '.dylib' if sys.platform == 'darwin' else '.so' + is_apple = (sys.platform == 'darwin' or "osxcross" in env) + + sharedlib_ext = '.dylib' if is_apple else '.so' mono_root = '' mono_lib_path = '' @@ -154,7 +156,7 @@ def configure(env): if os.getenv('MONO64_PREFIX'): mono_root = os.getenv('MONO64_PREFIX') - if not mono_root and sys.platform == 'darwin': + if not mono_root and is_apple: # Try with some known directories under OSX hint_dirs = ['/Library/Frameworks/Mono.framework/Versions/Current', '/usr/local/var/homebrew/linked/mono'] for hint_dir in hint_dirs: @@ -190,14 +192,14 @@ def configure(env): if mono_static: mono_lib_file = os.path.join(mono_lib_path, 'lib' + mono_lib + '.a') - if sys.platform == 'darwin': + if is_apple: env.Append(LINKFLAGS=['-Wl,-force_load,' + mono_lib_file]) else: env.Append(LINKFLAGS=['-Wl,-whole-archive', mono_lib_file, '-Wl,-no-whole-archive']) else: env.Append(LIBS=[mono_lib]) - if sys.platform == 'darwin': + if is_apple: env.Append(LIBS=['iconv', 'pthread']) else: env.Append(LIBS=['m', 'rt', 'dl', 'pthread']) |