aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-11-15 22:51:34 +0200
committerGitHub <noreply@github.com>2017-11-15 22:51:34 +0200
commite51da1a34d3ac2ed23451e05c971720c20aaa064 (patch)
tree4f929542408830518055b5258c3059931ade4d22 /mesonbuild/mesonlib.py
parentb9ef15a7193e55bb72216135066666b7bacbfaf0 (diff)
parentda654dd2b9ebb91a2202e7a841c4ae1c71ebf8ea (diff)
downloadmeson-e51da1a34d3ac2ed23451e05c971720c20aaa064.zip
meson-e51da1a34d3ac2ed23451e05c971720c20aaa064.tar.gz
meson-e51da1a34d3ac2ed23451e05c971720c20aaa064.tar.bz2
Merge pull request #2611 from mesonbuild/nirbheek/pkgconfig-msvc-static
Several fixes to pkg-config dependencies and the pkg-config module (try 3)
Diffstat (limited to 'mesonbuild/mesonlib.py')
-rw-r--r--mesonbuild/mesonlib.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index 5c4c374..f74c6c1 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -219,6 +219,42 @@ def is_cygwin():
def is_debianlike():
return os.path.isfile('/etc/debian_version')
+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 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 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 is_osx()
+ elif env.cross_info.has_host():
+ return env.cross_info.config['host_machine']['system'] == 'darwin'
+ return False
+
def exe_exists(arglist):
try:
p = subprocess.Popen(arglist, stdout=subprocess.PIPE, stderr=subprocess.PIPE)