diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-04-08 21:08:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-08 21:08:33 +0300 |
commit | aad21d26393326b61eefaef837aedb17e494f5ee (patch) | |
tree | 673663f68cd77f790cea2e11f1e48bdca0115f5e /mesonbuild/environment.py | |
parent | af820b77d88be0865169aa7f2f66a60f41675825 (diff) | |
parent | 44c54affda4526a90e20d457786fa6fc2d3cbe06 (diff) | |
download | meson-aad21d26393326b61eefaef837aedb17e494f5ee.zip meson-aad21d26393326b61eefaef837aedb17e494f5ee.tar.gz meson-aad21d26393326b61eefaef837aedb17e494f5ee.tar.bz2 |
Merge pull request #1567 from jon-turney/cygwin
Add Cygwin support
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index cb62506..7861612 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -158,7 +158,10 @@ def detect_cpu(compilers): return trial def detect_system(): - return platform.system().lower() + system = platform.system().lower() + if system.startswith('cygwin'): + return 'cygwin' + return system def for_windows(is_cross, env): @@ -173,6 +176,20 @@ def for_windows(is_cross, env): return env.cross_info.config['host_machine']['system'] == 'windows' return False + +def for_cygwin(is_cross, env): + """ + Host machine is cygwin? + + Note: 'host' is the machine on which compiled binaries will run + """ + if not is_cross: + return mesonlib.is_cygwin() + elif env.cross_info.has_host(): + return env.cross_info.config['host_machine']['system'] == 'cygwin' + return False + + def for_darwin(is_cross, env): """ Host machine is Darwin (iOS/OS X)? @@ -257,6 +274,11 @@ class Environment: self.exe_suffix = 'exe' self.object_suffix = 'obj' self.win_libdir_layout = True + elif (not cross and mesonlib.is_cygwin()) \ + or (cross and self.cross_info.has_host() and self.cross_info.config['host_machine']['system'] == 'cygwin'): + self.exe_suffix = 'exe' + self.object_suffix = 'o' + self.win_libdir_layout = True else: self.exe_suffix = '' self.object_suffix = 'o' @@ -368,7 +390,8 @@ class Environment: return GCC_OSX elif '__MINGW32__' in defines or '__MINGW64__' in defines: return GCC_MINGW - # We ignore Cygwin for now, and treat it as a standard GCC + elif '__CYGWIN__' in defines: + return GCC_CYGWIN return GCC_STANDARD def _get_compilers(self, lang, evar, want_cross): |