diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2018-08-23 23:17:08 +0200 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2018-09-17 19:34:35 +0200 |
commit | b032738a51e225c265131c46e5dd026687a40c19 (patch) | |
tree | a90e9da4a9c80c0b6b92fa6e87b48bc95a207adb /modules/mono | |
parent | ebd14a778d29e0de4904564a762358cbc2412303 (diff) |
Add some mono root dir hints to the build script
This enhancement is specially noticeable in OSX, since it includes Mono's install location (both official and homebrew). This makes it possible to build Godot with Mono on OSX without pkg-config (pkg-config is bundled with Mono, but it's not added to PATH, so finding it would require finding the Mono root directory first).
Diffstat (limited to 'modules/mono')
-rw-r--r-- | modules/mono/config.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/modules/mono/config.py b/modules/mono/config.py index 70fd1a35f1..bb0ae8d3f9 100644 --- a/modules/mono/config.py +++ b/modules/mono/config.py @@ -99,6 +99,8 @@ def configure(env): if not mono_root: raise RuntimeError('Mono installation directory not found') + print('Found Mono root directory: ' + mono_root) + mono_version = mono_root_try_find_mono_version(mono_root) configure_for_mono_version(env, mono_version) @@ -164,6 +166,14 @@ def configure(env): if os.getenv('MONO64_PREFIX'): mono_root = os.getenv('MONO64_PREFIX') + if not mono_root and sys.platform == 'darwin': + # 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: + if os.path.isdir(hint_dir): + mono_root = hint_dir + break + # We can't use pkg-config to link mono statically, # but we can still use it to find the mono root directory if not mono_root and mono_static: @@ -172,6 +182,8 @@ def configure(env): raise RuntimeError('Building with mono_static=yes, but failed to find the mono prefix with pkg-config. Specify one manually') if mono_root: + print('Found Mono root directory: ' + mono_root) + mono_version = mono_root_try_find_mono_version(mono_root) configure_for_mono_version(env, mono_version) @@ -216,6 +228,9 @@ def configure(env): else: assert not mono_static + # TODO: Add option to force using pkg-config + print('Mono root directory not found. Using pkg-config instead') + mono_version = pkgconfig_try_find_mono_version() configure_for_mono_version(env, mono_version) @@ -248,7 +263,7 @@ def configure(env): def configure_for_mono_version(env, mono_version): if mono_version is None: raise RuntimeError('Mono JIT compiler version not found') - print('Mono JIT compiler version: ' + str(mono_version)) + print('Found Mono JIT compiler version: ' + str(mono_version)) if mono_version >= LooseVersion("5.12.0"): env.Append(CPPFLAGS=['-DHAS_PENDING_EXCEPTIONS']) |