Bug 1375798 - Avoid using target_is_windows and target_is_darwin in library_name_info. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 23 Jun 2017 15:07:54 +0900
changeset 415129 8847981eee44dd2790d6628a1e791269696f015a
parent 415128 374900b2142af725d4136758ac00dce2fbb824be
child 415130 a07449eb1876e36e9d735c338f7ab873cc6878df
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1375798
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1375798 - Avoid using target_is_windows and target_is_darwin in library_name_info. r=mshal We eventually want to templatize the library_name_info function, in order to have one for host and one for target. So we don't want 3 different dependencies for the target.
moz.configure
--- a/moz.configure
+++ b/moz.configure
@@ -149,19 +149,19 @@ def is_openbsd(target):
 
 option(env='SO_VERSION', nargs=1, default='1.0', when=is_openbsd,
        help='Shared library version for OpenBSD systems')
 
 @depends('SO_VERSION', when=is_openbsd)
 def so_version(value):
     return value
 
-@depends(target, target_is_windows, target_is_darwin, c_compiler, so_version)
-def library_name_info(target, is_windows, is_darwin, c_compiler, so_version):
-    if is_windows:
+@depends(target, c_compiler, so_version)
+def library_name_info(target, c_compiler, so_version):
+    if target.kernel == 'WINNT':
         # There aren't artifacts for mingw builds, so it's OK that the results
         # are inaccurate in that case.
         if c_compiler and c_compiler.type not in ('msvc', 'clang-cl'):
             return namespace(
                 dll=namespace(prefix='', suffix='.dll'),
                 lib=namespace(prefix='lib', suffix='a'),
                 import_lib=namespace(prefix='lib', suffix='a'),
                 rust_lib=namespace(prefix='', suffix='lib'),
@@ -171,17 +171,17 @@ def library_name_info(target, is_windows
         return namespace(
             dll=namespace(prefix='', suffix='.dll'),
             lib=namespace(prefix='', suffix='lib'),
             import_lib=namespace(prefix='', suffix='lib'),
             rust_lib=namespace(prefix='', suffix='lib'),
             obj=namespace(prefix='', suffix='obj'),
         )
 
-    elif is_darwin:
+    elif target.kernel == 'Darwin':
         return namespace(
             dll=namespace(prefix='lib', suffix='.dylib'),
             lib=namespace(prefix='lib', suffix='a'),
             import_lib=namespace(prefix=None, suffix=''),
             rust_lib=namespace(prefix='lib', suffix='a'),
             obj=namespace(prefix='', suffix='o'),
         )
     elif so_version: