diff options
author | Gabriel Russell <gabriel.russell@mongodb.com> | 2018-01-25 13:44:59 -0500 |
---|---|---|
committer | Gabriel Russell <gabriel.russell@mongodb.com> | 2018-02-15 10:44:29 -0500 |
commit | b778690717b7aab1b0cb5274ce562d373c1bee4c (patch) | |
tree | 226b24d2b1ce1ba180d52a99bd78329138442e46 /site_scons | |
parent | dd1441218307fa6b1a141da4d1327de9f42dd8a9 (diff) | |
download | mongo-b778690717b7aab1b0cb5274ce562d373c1bee4c.tar.gz |
SERVER-32373 building android targets as TARGET_OS=android
Diffstat (limited to 'site_scons')
-rw-r--r-- | site_scons/mongo/platform.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/site_scons/mongo/platform.py b/site_scons/mongo/platform.py index c60ef0f9298..03b26f5bc0d 100644 --- a/site_scons/mongo/platform.py +++ b/site_scons/mongo/platform.py @@ -38,22 +38,20 @@ def env_get_os_name_wrapper(self): return self['TARGET_OS'] def is_os_raw(target_os, os_list_to_check): - okay = False - darwin_os_list = [ 'macOS', 'tvOS', 'tvOS-sim', 'iOS', 'iOS-sim' ] - posix_os_list = [ 'linux', 'openbsd', 'freebsd', 'solaris' ] + darwin_os_list + linux_os_list = [ 'android', 'linux' ] + posix_os_list = [ 'openbsd', 'freebsd', 'solaris' ] + darwin_os_list + linux_os_list + + os_families = { + "darwin": darwin_os_list, + "posix": posix_os_list, + "linux": linux_os_list, + } - for p in os_list_to_check: - if p == 'posix' and target_os in posix_os_list: - okay = True - break - if p == 'darwin' and target_os in darwin_os_list: - okay = True - break - elif p == target_os: - okay = True - break - return okay + for os in os_list_to_check: + if os == target_os or ( os in os_families and target_os in os_families[os] ): + return True + return False # This function tests the running OS as identified by Python # It should only be used to set up defaults for options/variables, because |