diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-11-02 19:41:48 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-11-11 23:06:48 +0530 |
commit | d2a250412c208a38a4c82a8b2615aad90dc15df9 (patch) | |
tree | 5bed892a787aabebccd6e61d552bb276a57b0e18 /mesonbuild/environment.py | |
parent | 4405a1297b2d76849b40843f8456d8c086c46516 (diff) | |
download | meson-d2a250412c208a38a4c82a8b2615aad90dc15df9.zip meson-d2a250412c208a38a4c82a8b2615aad90dc15df9.tar.gz meson-d2a250412c208a38a4c82a8b2615aad90dc15df9.tar.bz2 |
compilers: Improve manual library searching
We can now specify the library type we want to search for, and whether
we want to prefer static libraries over shared ones or the other way
around. This functionality is not exposed to build files yet.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 7f07c8d..d9146eb 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -219,46 +219,6 @@ def detect_system(): return 'cygwin' return system - -def for_windows(is_cross, env): - """ - Host machine is windows? - - Note: 'host' is the machine on which compiled binaries will run - """ - if not is_cross: - return mesonlib.is_windows() - elif env.cross_info.has_host(): - 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)? - - Note: 'host' is the machine on which compiled binaries will run - """ - if not is_cross: - return mesonlib.is_osx() - elif env.cross_info.has_host(): - return env.cross_info.config['host_machine']['system'] == 'darwin' - return False - - def search_version(text): # Usually of the type 4.1.4 but compiler output may contain # stuff like this: @@ -550,9 +510,9 @@ class Environment: cls = GnuCCompiler if lang == 'c' else GnuCPPCompiler return cls(ccache + compiler, version, gtype, is_cross, exe_wrap, defines) if 'clang' in out: - if 'Apple' in out or for_darwin(want_cross, self): + if 'Apple' in out or mesonlib.for_darwin(want_cross, self): cltype = CLANG_OSX - elif 'windows' in out or for_windows(want_cross, self): + elif 'windows' in out or mesonlib.for_windows(want_cross, self): cltype = CLANG_WIN else: cltype = CLANG_STANDARD |