Bug 1394734 - Replace CONFIG['MSVC'] by CONFIG['CC_TYPE'] r?glandium draft
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 08 Dec 2017 13:46:13 +0100
changeset 709656 75a06466af57112b2d46bafe411215bae1ebd8fe
parent 709655 36e5d3392a09268f833c850cd951007eb1f5eb90
child 709657 c51c8bf33b302c921ed996acb2c74b4733535097
push id92707
push userbmo:sledru@mozilla.com
push dateFri, 08 Dec 2017 12:47:21 +0000
reviewersglandium
bugs1394734
milestone59.0a1
Bug 1394734 - Replace CONFIG['MSVC'] by CONFIG['CC_TYPE'] r?glandium MozReview-Commit-ID: 5orfnoude7h
browser/app/moz.build
config/external/icu/defs.mozbuild
config/moz.build
dom/media/mp4/moz.build
dom/media/platforms/agnostic/bytestreams/moz.build
dom/media/platforms/ffmpeg/ffvpx/moz.build
dom/media/platforms/omx/moz.build
dom/media/systemservices/moz.build
dom/media/webrtc/moz.build
dom/plugins/ipc/moz.build
dom/plugins/test/testplugin/testplugin.mozbuild
gfx/angle/moz.build
gfx/angle/src/libANGLE/moz.build
gfx/angle/src/libGLESv2/moz.build
gfx/cairo/cairo/src/moz.build
gfx/cairo/libpixman/src/moz.build
gfx/layers/moz.build
gfx/qcms/moz.build
gfx/skia/generate_mozbuild.py
gfx/skia/moz.build
gfx/vr/moz.build
gfx/ycbcr/moz.build
ipc/app/moz.build
ipc/chromium/chromium-config.mozbuild
ipc/glue/moz.build
ipc/ipdl/test/cxx/app/moz.build
js/src/gdb/moz.build
js/src/jsapi-tests/moz.build
js/src/moz.build
js/src/shell/moz.build
js/xpconnect/shell/moz.build
js/xpconnect/wrappers/moz.build
layout/base/moz.build
layout/painting/moz.build
media/ffvpx/ffvpxcommon.mozbuild
media/gmp-clearkey/0.1/moz.build
media/libaom/moz.build
media/libav/libavcommon.mozbuild
media/libav/moz.build
media/libcubeb/src/moz.build
media/libopus/moz.build
media/libspeex_resampler/src/moz.build
media/libtheora/moz.build
media/libvpx/moz.build
media/webrtc/moz.build
media/webrtc/signaling/gtest/moz.build
media/webrtc/trunk/gtest/moz.build
memory/build/moz.build
memory/mozalloc/moz.build
mfbt/tests/moz.build
modules/fdlibm/src/moz.build
security/certverifier/moz.build
security/pkix/moz.build
security/pkix/test/gtest/moz.build
security/pkix/warnings.mozbuild
security/sandbox/moz.build
toolkit/components/jsoncpp/src/lib_json/moz.build
toolkit/components/maintenanceservice/moz.build
toolkit/components/protobuf/moz.build
toolkit/crashreporter/crashreporter.mozbuild
toolkit/crashreporter/test/moz.build
toolkit/library/moz.build
toolkit/mozapps/update/updater/updater-common.build
widget/windows/moz.build
xpcom/glue/standalone/moz.build
xpcom/io/moz.build
xpcom/string/moz.build
xpcom/typelib/xpt/moz.build
--- a/browser/app/moz.build
+++ b/browser/app/moz.build
@@ -57,17 +57,17 @@ if CONFIG['LIBFUZZER']:
     USE_LIBS += [ 'fuzzer' ]
     LOCAL_INCLUDES += [
         '/tools/fuzzing/libfuzzer',
     ]
 
 if CONFIG['ENABLE_GECKODRIVER']:
     DEFINES['MOZ_GECKODRIVER'] = True
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # Always enter a Windows program through wmain, whether or not we're
     # a console application.
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     RCINCLUDE = 'splash.rc'
     DEFINES['MOZ_PHOENIX'] = True
 
--- a/config/external/icu/defs.mozbuild
+++ b/config/external/icu/defs.mozbuild
@@ -42,17 +42,17 @@ if CONFIG['CLANG_CL']:
         '-Wno-macro-redefined',
         '-Wno-microsoft-include',
     ]
     CXXFLAGS += [
         '-Wno-macro-redefined',
         '-Wno-microsoft-include',
     ]
 
-if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl') and not CONFIG['CLANG_CL']:
     CFLAGS += [
         '-wd4005', # 'WIN32_LEAN_AND_MEAN' : macro redefinition
         '-wd4996', # The compiler encountered a deprecated declaration.
     ]
     CXXFLAGS += [
         '-wd4005', # 'WIN32_LEAN_AND_MEAN' : macro redefinition
         '-wd4333', # '>>' : right shift by too large amount, data loss
         '-wd4996', # The compiler encountered a deprecated declaration.
--- a/config/moz.build
+++ b/config/moz.build
@@ -43,17 +43,17 @@ HOST_DEFINES = {
     '_UNICODE': True,
 }
 
 include('stl-headers.mozbuild')
 if CONFIG['WRAP_STL_INCLUDES']:
     stl_compiler = None
     if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
         stl_compiler = 'gcc'
-    elif CONFIG['_MSC_VER']:
+    elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         stl_compiler = 'msvc'
 
     if stl_compiler:
         template_file = SRCDIR + '/%s-stl-wrapper.template.h' % stl_compiler
         output_dir = '../dist/stl_wrappers'
         # We have to use a sentinel file as the first file because the
         # file_generate action will create it for us, but we want to create all
         # the files in gen_wrappers()
--- a/dom/media/mp4/moz.build
+++ b/dom/media/mp4/moz.build
@@ -36,17 +36,17 @@ UNIFIED_SOURCES += [
 
 SOURCES += [
     'MP4Demuxer.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 # Supress warnnings for now.
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CFLAGS += [
         '-wd4013', # 'function' undefined; assuming extern returning int
         '-wd4101', # unreferenced local variable
     ]
     CXXFLAGS += [
         '-wd4018', # '<' : signed/unsigned mismatch
         '-wd4275', # non dll-interface class used as base for dll-interface class
         '-wd4305', # '=' : truncation from 'double' to 'float'
--- a/dom/media/platforms/agnostic/bytestreams/moz.build
+++ b/dom/media/platforms/agnostic/bytestreams/moz.build
@@ -21,17 +21,17 @@ UNIFIED_SOURCES += [
 
 LOCAL_INCLUDES += [
     '../../../mp4/',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 # Suppress warnings in third-party code.
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CFLAGS += [
         '-wd4013', # 'function' undefined; assuming extern returning int
         '-wd4101', # unreferenced local variable
     ]
     CXXFLAGS += [
         '-wd4018', # '<' : signed/unsigned mismatch
         '-wd4275', # non dll-interface class used as base for dll-interface class
         '-wd4305', # '=' : truncation from 'double' to 'float'
--- a/dom/media/platforms/ffmpeg/ffvpx/moz.build
+++ b/dom/media/platforms/ffmpeg/ffvpx/moz.build
@@ -29,17 +29,17 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
   CXXFLAGS += [ '-Wno-deprecated-declarations' ]
 if CONFIG['CLANG_CXX']:
   CXXFLAGS += [
     '-Wno-unknown-attributes',
   ]
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
   CXXFLAGS += [
     '-wd4996', # deprecated declaration
   ]
 
 DEFINES['FFVPX_VERSION'] = 46465650
 DEFINES['USING_MOZFFVPX'] = True
 
 FINAL_LIBRARY = 'xul'
--- a/dom/media/platforms/omx/moz.build
+++ b/dom/media/platforms/omx/moz.build
@@ -21,14 +21,14 @@ LOCAL_INCLUDES += [
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # Avoid warnings from third-party code that we can not modify.
     if CONFIG['CLANG_CL']:
         CXXFLAGS += ['-Wno-invalid-source-encoding']
     else:
         CXXFLAGS += ['-validate-charset-']
--- a/dom/media/systemservices/moz.build
+++ b/dom/media/systemservices/moz.build
@@ -35,17 +35,17 @@ if CONFIG['OS_TARGET'] == 'Android':
     UNIFIED_SOURCES += [
         'OpenSLESProvider.cpp',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
   UNIFIED_SOURCES += ['OSXRunLoopSingleton.cpp']
   EXPORTS += ['OSXRunLoopSingleton.h']
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     DEFINES['__PRETTY_FUNCTION__'] = '__FUNCSIG__'
 
     # This is intended as a temporary workaround to enable building with VS2015.
     # media\webrtc\trunk\webrtc/base/criticalsection.h(59): warning C4312:
     # 'reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
     CXXFLAGS += ['-wd4312']
 
 EXPORTS.mozilla += ['ShmemPool.h',]
--- a/dom/media/webrtc/moz.build
+++ b/dom/media/webrtc/moz.build
@@ -73,15 +73,15 @@ include('/ipc/chromium/chromium-config.m
 if CONFIG['CC_TYPE'] in ('clang', 'gcc') or CONFIG['CLANG_CL']:
     CXXFLAGS += [
         '-Wno-error=attributes',
         '-Wno-error=shadow',
     ]
 
 FINAL_LIBRARY = 'xul'
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += [
         '-wd4275', # non dll-interface class used as base for dll-interface class
         '-wd4312', # This is intended as a temporary hack to support building with VS2015
                    # 'reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
     ]
     DEFINES['__PRETTY_FUNCTION__'] = '__FUNCSIG__'
--- a/dom/plugins/ipc/moz.build
+++ b/dom/plugins/ipc/moz.build
@@ -134,15 +134,15 @@ else:
     # Force build against gtk+2 for struct offsets and such.
     CXXFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary hack to support building with VS2015.
     # conversion from 'X' to 'Y' requires a narrowing conversion
     CXXFLAGS += ['-wd4838']
 
     # 'type cast': conversion from 'unsigned int' to 'HIMC' of greater size
     CXXFLAGS += ['-wd4312']
--- a/dom/plugins/test/testplugin/testplugin.mozbuild
+++ b/dom/plugins/test/testplugin/testplugin.mozbuild
@@ -50,17 +50,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
     CXXFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
     CFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
     OS_LIBS += CONFIG['MOZ_GTK2_LIBS']
     OS_LIBS += CONFIG['XLDFLAGS']
     OS_LIBS += CONFIG['XLIBS']
     OS_LIBS += CONFIG['XEXT_LIBS']
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary hack to support building with VS2015.
     # conversion from 'X' to 'Y' requires a narrowing conversion
     CXXFLAGS += ['-wd4838']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     FINAL_TARGET = 'dist/plugins/%s.plugin/Contents/MacOS' % cocoa_name
     OBJDIR_FILES.dist.plugins['%s.plugin' % cocoa_name].Contents += ['%s/Info.plist' % relative_path]
 else:
--- a/gfx/angle/moz.build
+++ b/gfx/angle/moz.build
@@ -155,17 +155,17 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
             '-Wno-unused-private-field',
         ]
     else:
         CXXFLAGS += [
             '-Wno-shadow-compatible-local',
             '-Wno-shadow-local',
         ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd5038'] # C5038: initializer list order warnings
 
 if CONFIG['MOZ_DIRECTX_SDK_PATH'] and not CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
     LOCAL_INCLUDES += ['%' + '%s/include/' % CONFIG['MOZ_DIRECTX_SDK_PATH']]
 
 DEFINES['_CRT_SECURE_NO_DEPRECATE'] = True
 DEFINES['_HAS_EXCEPTIONS'] = 0
 
--- a/gfx/angle/src/libANGLE/moz.build
+++ b/gfx/angle/src/libANGLE/moz.build
@@ -354,17 +354,17 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
             '-Wno-unused-private-field',
         ]
     else:
         CXXFLAGS += [
             '-Wno-shadow-compatible-local',
             '-Wno-shadow-local',
         ]
 
-if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl') and not CONFIG['CLANG_CL']:
     CXXFLAGS += [
         '-wd4018', # '>' : signed/unsigned mismatch
         '-wd4530', # C++ exception handler used, without /EHsc
         '-wd5038', # C5038: initializer list order warnings
     ]
 
 if CONFIG['MOZ_DIRECTX_SDK_PATH'] and not CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
     LOCAL_INCLUDES += ['%' + '%s/include/' % CONFIG['MOZ_DIRECTX_SDK_PATH']]
--- a/gfx/angle/src/libGLESv2/moz.build
+++ b/gfx/angle/src/libGLESv2/moz.build
@@ -34,17 +34,17 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
             '-Wno-unused-private-field',
         ]
     else:
         CXXFLAGS += [
             '-Wno-shadow-compatible-local',
             '-Wno-shadow-local',
         ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd5038'] # C5038: initializer list order warnings
 
 if CONFIG['MOZ_DIRECTX_SDK_PATH'] and not CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
     LOCAL_INCLUDES += ['%' + '%s/include/' % CONFIG['MOZ_DIRECTX_SDK_PATH']]
 
 DEFINES['_CRT_SECURE_NO_DEPRECATE'] = True
 DEFINES['_HAS_EXCEPTIONS'] = 0
 
--- a/gfx/cairo/cairo/src/moz.build
+++ b/gfx/cairo/cairo/src/moz.build
@@ -238,17 +238,17 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
             '-Wno-shift-negative-value',
             '-Wno-tautological-compare',
             '-Wno-tautological-constant-out-of-range-compare',
             '-Wno-unreachable-code',
         ]
     else:
         CFLAGS += ['-Wno-unused-but-set-variable']
 
-if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl') and not CONFIG['CLANG_CL']:
     CFLAGS += [
         '-wd4005', # 'WIN32_LEAN_AND_MEAN' : macro redefinition
         '-wd4018', # '>' : signed/unsigned mismatch
         '-wd4047', # different levels of indirection
         '-wd4101', # unreferenced local variable
         '-wd4133', # 'function' : incompatible types
         '-wd4146', # unary minus operator applied to unsigned type
         '-wd4311', # 'variable' : pointer truncation from 'type' to 'type'
--- a/gfx/cairo/libpixman/src/moz.build
+++ b/gfx/cairo/libpixman/src/moz.build
@@ -80,17 +80,17 @@ DEFINES['_USE_MATH_DEFINES'] = True
 use_mmx = False
 use_sse2 = False
 use_vmx = False
 use_arm_simd_gcc = False
 use_arm_neon_gcc = False
 if '86' in CONFIG['OS_TEST']:
     use_sse2 = True
     if '64' not in CONFIG['OS_TEST']:
-        if CONFIG['_MSC_VER']:
+        if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
             use_mmx = True
     if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
         use_mmx = True
 elif 'ppc' in CONFIG['OS_TEST']:
     if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
         use_vmx = True
 # Apple's arm assembler doesn't support the same syntax as
 # the standard GNU assembler, so use the C fallback paths for now.
@@ -150,17 +150,17 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_
         '-Wno-incompatible-pointer-types',
         '-Wno-tautological-compare',
         '-Wno-tautological-constant-out-of-range-compare',
     ]
 if CONFIG['CLANG_CL']:
     CFLAGS += [
         '-Wno-unused-variable',
     ]
-if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl') and not CONFIG['CLANG_CL']:
     CFLAGS += [
         '-wd4047', # different levels of indirection
         '-wd4101', # unreferenced local variable
         '-wd4133', # 'function' : incompatible types
         '-wd4146', # unary minus operator applied to unsigned type
         '-wd4311', # 'variable' : pointer truncation from 'type' to 'type'
     ]
 
--- a/gfx/layers/moz.build
+++ b/gfx/layers/moz.build
@@ -488,17 +488,17 @@ SOURCES += [
     'protobuf/LayerScopePacket.pb.cc',
     'wr/WebRenderTextureHost.cpp',
 ]
 
 DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
 DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
 
 # Workaround compiler bug (Bug 795594)
-if CONFIG['_MSC_VER'] and CONFIG['CPU_ARCH'] == 'x86_64':
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl') and CONFIG['CPU_ARCH'] == 'x86_64':
     for src in [
         'Layers.cpp',
         'LayerTreeInvalidation.cpp',
     ]:
         SOURCES[src].no_pgo = True
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     SOURCES += [
--- a/gfx/qcms/moz.build
+++ b/gfx/qcms/moz.build
@@ -22,17 +22,17 @@ FINAL_LIBRARY = 'xul'
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CFLAGS += ['-Wno-missing-field-initializers']
 
 use_sse1 = False
 use_sse2 = False
 use_altivec = False
 if '86' in CONFIG['OS_TEST']:
     use_sse2 = True
-    if CONFIG['_MSC_VER']:
+    if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         if CONFIG['OS_ARCH'] != 'WINNT' or CONFIG['OS_TEST'] != 'x86_64':
             use_sse1 = True
     else:
         use_sse1 = True
 elif CONFIG['HAVE_ALTIVEC']:
     use_altivec = True
 
 if use_sse1:
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -19,17 +19,17 @@ header = """
 # debugging generate_mozbuild.py.
 #
 # DO NOT MODIFY THIS FILE IT IS AUTOGENERATED.
 #
 
 skia_opt_flags = []
 
 if CONFIG['MOZ_OPTIMIZE']:
-    if CONFIG['_MSC_VER']:
+    if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         skia_opt_flags += ['-O2']
     elif CONFIG['CC_TYPE'] in ('clang', 'gcc'):
         skia_opt_flags += ['-O3']
 
 """
 
 footer = """
 
@@ -80,17 +80,17 @@ if CONFIG['INTEL_ARCHITECTURE'] and (CON
     SOURCES['skia/src/opts/SkBitmapProcState_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
     SOURCES['skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp'].flags += ['-mssse3']
     SOURCES['skia/src/opts/SkBlitRow_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
     SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3']
     SOURCES['skia/src/opts/SkOpts_sse41.cpp'].flags += ['-msse4.1']
     SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2']
     SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx']
     SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2']
-elif CONFIG['_MSC_VER']:
+elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # MSVC doesn't need special compiler flags, but Skia needs to be told that these files should
     # be built with the required SSE level or it will simply compile in stubs and cause runtime crashes
     SOURCES['skia/src/opts/SkBitmapProcState_opts_SSE2.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=20']
     SOURCES['skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=31']
     SOURCES['skia/src/opts/SkBlitRow_opts_SSE2.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=20']
     SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=31']
     SOURCES['skia/src/opts/SkOpts_sse41.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=41']
     SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=42']
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -12,17 +12,17 @@
 # debugging generate_mozbuild.py.
 #
 # DO NOT MODIFY THIS FILE IT IS AUTOGENERATED.
 #
 
 skia_opt_flags = []
 
 if CONFIG['MOZ_OPTIMIZE']:
-    if CONFIG['_MSC_VER']:
+    if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         skia_opt_flags += ['-O2']
     elif CONFIG['CC_TYPE'] in ('clang', 'gcc'):
         skia_opt_flags += ['-O3']
 
 UNIFIED_SOURCES += [
     'skia/src/core/SkAAClip.cpp',
     'skia/src/core/SkAlphaRuns.cpp',
     'skia/src/core/SkAnalyticEdge.cpp',
@@ -725,17 +725,17 @@ if CONFIG['INTEL_ARCHITECTURE'] and (CON
     SOURCES['skia/src/opts/SkBitmapProcState_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
     SOURCES['skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp'].flags += ['-mssse3']
     SOURCES['skia/src/opts/SkBlitRow_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
     SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3']
     SOURCES['skia/src/opts/SkOpts_sse41.cpp'].flags += ['-msse4.1']
     SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2']
     SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx']
     SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2']
-elif CONFIG['_MSC_VER']:
+elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # MSVC doesn't need special compiler flags, but Skia needs to be told that these files should
     # be built with the required SSE level or it will simply compile in stubs and cause runtime crashes
     SOURCES['skia/src/opts/SkBitmapProcState_opts_SSE2.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=20']
     SOURCES['skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=31']
     SOURCES['skia/src/opts/SkBlitRow_opts_SSE2.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=20']
     SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=31']
     SOURCES['skia/src/opts/SkOpts_sse41.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=41']
     SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=42']
--- a/gfx/vr/moz.build
+++ b/gfx/vr/moz.build
@@ -85,12 +85,12 @@ CXXFLAGS += CONFIG['TK_CFLAGS']
 CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CFLAGS += CONFIG['TK_CFLAGS']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 # This is intended as a temporary hack to enable VS2015 builds.
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # ovr_capi_dynamic.h '<unnamed-tag>': Alignment specifier is less than
     # actual alignment (8), and will be ignored
     CXXFLAGS += ['-wd4359']
--- a/gfx/ycbcr/moz.build
+++ b/gfx/ycbcr/moz.build
@@ -19,26 +19,26 @@ UNIFIED_SOURCES += [
 
 if CONFIG['INTEL_ARCHITECTURE']:
     # These files use MMX and SSE2 intrinsics, so they need special compile flags
     # on some compilers.
     SOURCES += ['yuv_convert_sse2.cpp']
     SOURCES['yuv_convert_sse2.cpp'].flags += CONFIG['SSE2_FLAGS']
 
     # MSVC doesn't support MMX when targeting AMD64.
-    if CONFIG['_MSC_VER']:
+    if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         if CONFIG['OS_TEST'] != 'x86_64':
             SOURCES += [
                 'yuv_convert_mmx.cpp',
             ]
     else:
         SOURCES += ['yuv_convert_mmx.cpp']
         SOURCES['yuv_convert_mmx.cpp'].flags += CONFIG['MMX_FLAGS']
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     if CONFIG['OS_TEST'] == 'x86_64':
         SOURCES += [
             'yuv_row_win64.cpp',
         ]
     else:
         SOURCES += [
             'yuv_row_win.cpp',
         ]
--- a/ipc/app/moz.build
+++ b/ipc/app/moz.build
@@ -58,17 +58,17 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_
     LOCAL_INCLUDES += [
         '/security/sandbox/chromium',
         '/security/sandbox/chromium-shim',
     ]
     USE_LIBS += [
         'mozsandbox',
     ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # Always enter a Windows program through wmain, whether or not we're
     # a console application.
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 
 # Control the default heap size.
 # This is the heap returned by GetProcessHeap().
 # As we use the CRT heap, the default size is too large and wastes VM.
 #
--- a/ipc/chromium/chromium-config.mozbuild
+++ b/ipc/chromium/chromium-config.mozbuild
@@ -26,17 +26,17 @@ if CONFIG['OS_ARCH'] == 'WINNT':
         'U_STATIC_IMPLEMENTATION': True,
         'OS_WIN': 1,
         'WIN32': True,
         '_WIN32': True,
         '_WINDOWS': True,
         'WIN32_LEAN_AND_MEAN': True,
     })
 
-    if CONFIG['_MSC_VER']:
+    if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         DEFINES['COMPILER_MSVC'] = True
 
 else:
     DEFINES['OS_POSIX'] = 1
 
     if CONFIG['OS_ARCH'] == 'Darwin':
         DEFINES['OS_MACOSX'] = 1
 
--- a/ipc/glue/moz.build
+++ b/ipc/glue/moz.build
@@ -173,17 +173,17 @@ if CONFIG['OS_ARCH'] == 'Darwin':
     SOURCES += [
         'GeckoChildProcessHost.cpp',
     ]
 else:
     UNIFIED_SOURCES += [
         'GeckoChildProcessHost.cpp',
     ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary hack to support building with VS2015.
     # 'reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
     SOURCES['BackgroundChildImpl.cpp'].flags += ['-wd4312']
     SOURCES['BackgroundParentImpl.cpp'].flags += ['-wd4312']
 
 LOCAL_INCLUDES += [
     '/caps',
     '/dom/broadcastchannel',
--- a/ipc/ipdl/test/cxx/app/moz.build
+++ b/ipc/ipdl/test/cxx/app/moz.build
@@ -11,10 +11,10 @@ SOURCES += [
 ]
 include('/ipc/chromium/chromium-config.mozbuild')
 
 LOCAL_INCLUDES += [
     '/toolkit/xre',
     '/xpcom/base',
 ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
--- a/js/src/gdb/moz.build
+++ b/js/src/gdb/moz.build
@@ -40,14 +40,14 @@ if CONFIG['ENABLE_INTL_API'] and CONFIG[
     USE_LIBS += ['icudata']
 
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-shadow', '-fno-strict-aliasing']
 
 # This is intended as a temporary workaround to enable VS2015.
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd4312']
 
 DEFINES['topsrcdir'] = '%s/js/src' % TOPSRCDIR
 FINAL_TARGET_PP_FILES += ['gdb-tests-gdb.py.in']
 OBJDIR_FILES.js.src.gdb += ['!/dist/bin/gdb-tests-gdb.py']
--- a/js/src/jsapi-tests/moz.build
+++ b/js/src/jsapi-tests/moz.build
@@ -157,13 +157,13 @@ if CONFIG['MOZ_NEEDS_LIBATOMIC']:
     OS_LIBS += ['atomic']
 
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-shadow', '-Werror=format', '-fno-strict-aliasing']
 
 # This is intended as a temporary workaround to enable VS2015.
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd4312']
 
 DEFINES['topsrcdir'] = '%s/js/src' % TOPSRCDIR
 OBJDIR_PP_FILES.js.src['jsapi-tests'] += ['jsapi-tests-gdb.py.in']
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -660,17 +660,17 @@ DEFINES['EXPORT_JS_API'] = True
 if CONFIG['JS_HAS_CTYPES']:
     DEFINES['JS_HAS_CTYPES'] = True
     for var in ('DLL_PREFIX', 'DLL_SUFFIX'):
         DEFINES[var] = '"%s"' % CONFIG[var]
 
 if CONFIG['MOZ_LINKER']:
     DEFINES['MOZ_LINKER'] = True
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     if CONFIG['CPU_ARCH'] == 'x86':
         SOURCES['builtin/RegExp.cpp'].no_pgo = True # Bug 772303
     elif CONFIG['CPU_ARCH'] == 'x86_64' and CONFIG['JS_HAS_CTYPES']:
         SOURCES['ctypes/CTypes.cpp'].no_pgo = True # Bug 810661
     # Prevent floating point errors caused by VC++ optimizations
     # XXX We should add this to CXXFLAGS, too?
     CFLAGS += ['-fp:precise']
     # C4805 warns mixing bool with other integral types in computation.
--- a/js/src/shell/moz.build
+++ b/js/src/shell/moz.build
@@ -17,17 +17,17 @@ UNIFIED_SOURCES += [
     'OSObject.cpp'
 ]
 
 DEFINES['EXPORT_JS_API'] = True
 
 # Also set in ../moz.build
 DEFINES['ENABLE_SHARED_ARRAY_BUFFER'] = True
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # unnecessary PGO for js shell.  But gcc cannot turn off pgo because it is
     # necessary to link PGO lib on gcc when a object/static lib are compiled
     # for PGO.
     NO_PGO = True
 
 LOCAL_INCLUDES += [
     '!..',
     '..',
@@ -49,17 +49,17 @@ shellmoduleloader.inputs = [
     '../js.msg',
     'ModuleLoader.js',
 ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-shadow', '-Werror=format']
 
 # This is intended as a temporary workaround to enable VS2015.
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd4312']
 
 # Place a GDB Python auto-load file next to the shell executable, both in
 # the build directory and in the dist/bin directory.
 DEFINES['topsrcdir'] = '%s/js/src' % TOPSRCDIR
 FINAL_TARGET_PP_FILES += ['js-gdb.py.in']
 OBJDIR_FILES.js.src.shell += ['!/dist/bin/js-gdb.py']
 
--- a/js/xpconnect/shell/moz.build
+++ b/js/xpconnect/shell/moz.build
@@ -16,17 +16,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 LOCAL_INCLUDES += [
     '/toolkit/xre',
 ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # Always enter a Windows program through wmain, whether or not we're
     # a console application.
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 
 # DELAYLOAD_DLLS in this block ensure that the DLL blocklist initializes
 if CONFIG['OS_ARCH'] == 'WINNT':
     RCINCLUDE = 'xpcshell.rc'
 
--- a/js/xpconnect/wrappers/moz.build
+++ b/js/xpconnect/wrappers/moz.build
@@ -18,17 +18,17 @@ UNIFIED_SOURCES += [
 ]
 
 # XrayWrapper needs to be built separately becaue of template instantiations.
 SOURCES += [
     'XrayWrapper.cpp',
 ]
 
 # warning C4661 for FilteringWrapper
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += [
         '-wd4661', # no suitable definition provided for explicit template instantiation request
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
--- a/layout/base/moz.build
+++ b/layout/base/moz.build
@@ -162,15 +162,15 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'andr
 
 FINAL_LIBRARY = 'xul'
 
 BROWSER_CHROME_MANIFESTS += ['tests/browser.ini']
 MARIONETTE_LAYOUT_MANIFESTS += ['tests/marionette/manifest.ini']
 MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
 MOCHITEST_CHROME_MANIFESTS += ['tests/chrome/chrome.ini']
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary hack to support building with VS2015.
     # 'type cast': conversion from 'unsigned int' to 'void *' of greater size
     CXXFLAGS += ['-wd4312']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
--- a/layout/painting/moz.build
+++ b/layout/painting/moz.build
@@ -62,15 +62,15 @@ LOCAL_INCLUDES += [
     '/layout/tables',
     '/layout/xul',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary hack to support building with VS2015.
     # 'type cast': conversion from 'unsigned int' to 'void *' of greater size
     CXXFLAGS += ['-wd4312']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
--- a/media/ffvpx/ffvpxcommon.mozbuild
+++ b/media/ffvpx/ffvpxcommon.mozbuild
@@ -71,17 +71,17 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
         ]
     else:
         CFLAGS += [
             '-Wno-discarded-qualifiers',
             '-Wno-maybe-uninitialized',
         ]
     # Force visibility of cpu and av_log symbols.
     CFLAGS += ['-include', 'libavutil_visibility.h']
-elif CONFIG['_MSC_VER']:
+elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CFLAGS += [
         '-wd4090', # 'return' : different 'const' qualifiers
         '-wd4018', # '>' : signed/unsigned mismatch
         '-wd4305', # 'initializing' : truncation from '__int64' to 'double'
         '-wd4554', # '>>' : check operator precedence for possible error
         '-wd4307', # '+' : integral constant overflow'
         '-wd4028', # formal parameter 1 different from declaration
         '-wd4056', # overflow in floating-point constant arithmetic
--- a/media/gmp-clearkey/0.1/moz.build
+++ b/media/gmp-clearkey/0.1/moz.build
@@ -61,13 +61,13 @@ USE_LIBS += ['psshparser']
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CFLAGS += [
         '-Wno-missing-braces',
         '-Wno-pointer-to-int-cast',
         '-Wno-sign-compare',
         '-include', 'stdio.h',      # for sprintf() prototype
         '-include', 'unistd.h',     # for getpid() prototype
     ]
-elif CONFIG['_MSC_VER']:
+elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CFLAGS += [
         '-FI', 'stdio.h',           # for sprintf() prototype
         '-wd4090',                  # '=' : different 'const' qualifiers
     ]
--- a/media/libaom/moz.build
+++ b/media/libaom/moz.build
@@ -92,30 +92,30 @@ if CONFIG['OS_TARGET'] == 'Android':
     # the OS they're on, so do it for them.
     DEFINES['__linux__'] = True
 
     if not CONFIG['MOZ_WEBRTC']:
         SOURCES += [
             '%%%s/sources/android/cpufeatures/cpu-features.c' % CONFIG['ANDROID_NDK'],
         ]
 
-if CONFIG['CLANG_CL'] or not CONFIG['_MSC_VER']:
+if CONFIG['CLANG_CL'] or CONFIG['CC_TYPE'] not in ('msvc', 'clang-cl'):
     for f in SOURCES:
         if f.endswith('sse2.c'):
             SOURCES[f].flags += CONFIG['SSE2_FLAGS']
         elif f.endswith('ssse3.c'):
             SOURCES[f].flags += ['-mssse3']
         elif f.endswith('sse4.c'):
             SOURCES[f].flags += ['-msse4.1']
         elif f.endswith('avx.c'):
             SOURCES[f].flags += ['-mavx']
         elif f.endswith('avx2.c'):
             SOURCES[f].flags += ['-mavx2']
 
-if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl') and not CONFIG['CLANG_CL']:
     for f in SOURCES:
         if f.endswith('avx.c'):
             SOURCES[f].flags += ['-arch:AVX']
         if f.endswith('avx2.c'):
             SOURCES[f].flags += ['-arch:AVX2']
 
 # Suppress warnings in third-party code.
 if CONFIG['CC_TYPE'] in ('clang', 'gcc') or CONFIG['CLANG_CL']:
--- a/media/libav/libavcommon.mozbuild
+++ b/media/libav/libavcommon.mozbuild
@@ -36,16 +36,16 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
         '-Wno-switch',
         '-Wno-type-limits',
     ]
 if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']:
     CFLAGS += [
         '-Wno-incompatible-pointer-types-discards-qualifiers',
         '-Wno-logical-op-parentheses',
     ]
-if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl') and not CONFIG['CLANG_CL']:
     CFLAGS += [
         '-wd4090', # 'return' : different 'const' qualifiers
         '-wd4018', # '>' : signed/unsigned mismatch
         '-wd4305', # 'initializing' : truncation from '__int64' to 'double'
     ]
 
 FINAL_LIBRARY = 'lgpllibs'
--- a/media/libav/moz.build
+++ b/media/libav/moz.build
@@ -48,17 +48,17 @@ UNIFIED_SOURCES += [
     'libavutil/mem.c',
     'libavutil/parseutils.c',
     'libavutil/random_seed.c',
     'libavutil/rational.c',
     'libavutil/sha.c',
 ]
 
 # Dummy functions are required for windows NoOpt/PGO builds.
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     UNIFIED_SOURCES += [
         'avfft_dummy_funcs.c'
     ]
 
 # OS X requires a special header to make sure symbols are exported publicly in
 # the lgpl shared library, since it does not yet use system headers. This is
 # also used on linux for the time being, to avoid having to patch libav code.
 #
--- a/media/libcubeb/src/moz.build
+++ b/media/libcubeb/src/moz.build
@@ -66,17 +66,17 @@ if CONFIG['OS_TARGET'] == 'WINNT':
         'cubeb_wasapi.cpp',
         'cubeb_winmm.c',
     ]
     DEFINES['USE_WINMM'] = True
     DEFINES['USE_WASAPI'] = True
     OS_LIBS += [
       "avrt",
     ]
-    if CONFIG['_MSC_VER']:
+    if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         CXXFLAGS += ['-wd4005'] # C4005: '_USE_MATH_DEFINES' : macro redefinition
 
 if CONFIG['OS_TARGET'] == 'Android':
     SOURCES += ['cubeb_opensl.c']
     SOURCES += ['cubeb_resampler.cpp']
     DEFINES['USE_OPENSL'] = True
     SOURCES += [
         'cubeb_audiotrack.c',
--- a/media/libopus/moz.build
+++ b/media/libopus/moz.build
@@ -93,17 +93,17 @@ if CONFIG['CPU_ARCH'] in ('x86', 'x86_64
     DEFINES['OPUS_X86_MAY_HAVE_SSE4_1'] = True
     DEFINES['OPUS_X86_MAY_HAVE_AVX'] = True
     SOURCES += celt_sources_sse
     SOURCES += celt_sources_sse2
     SOURCES += celt_sources_sse4_1
     SOURCES += silk_sources_sse4_1
     if not CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
         SOURCES += silk_sources_fixed_sse4_1
-    if not CONFIG['_MSC_VER'] or CONFIG['CLANG_CL']:
+    if CONFIG['CC_TYPE'] not in ('msvc', 'clang-cl') or CONFIG['CLANG_CL']:
         for f in SOURCES:
             if f in celt_sources_sse:
                 SOURCES[f].flags += CONFIG['SSE_FLAGS']
             if f in celt_sources_sse2:
                 SOURCES[f].flags += CONFIG['SSE2_FLAGS']
             if f in celt_sources_sse4_1 or \
                f in silk_sources_sse4_1 or \
                f in silk_sources_fixed_sse4_1:
--- a/media/libspeex_resampler/src/moz.build
+++ b/media/libspeex_resampler/src/moz.build
@@ -45,13 +45,13 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFI
         'resample_neon.c'
     ]
     SOURCES['resample_neon.c'].flags += CONFIG['NEON_FLAGS']
 
 # Suppress warnings in third-party code.
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CFLAGS += ['-Wno-sign-compare']
 
-if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl') and not CONFIG['CLANG_CL']:
     CFLAGS += [
         '-wd4018', # '<' : signed/unsigned mismatch
         '-wd4101', # unreferenced local variable
     ]
--- a/media/libtheora/moz.build
+++ b/media/libtheora/moz.build
@@ -54,17 +54,17 @@ if '86' in CONFIG['OS_TEST']:
     if CONFIG['OS_ARCH'] != 'SunOS':
         if CONFIG['CLANG_CL']:
             # clang-cl can't handle libtheora's inline asm.
             pass
         elif CONFIG['OS_ARCH'] != 'WINNT' or CONFIG['OS_TEST'] != 'x86_64':
             DEFINES['OC_X86_ASM'] = True
             if '64' in CONFIG['OS_TEST']:
                 DEFINES['OC_X86_64_ASM'] = True
-    if CONFIG['_MSC_VER']:
+    if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         if CONFIG['CLANG_CL']:
             # clang-cl can't handle libtheora's inline asm.
             pass
         elif '64' not in CONFIG['OS_TEST']:
             SOURCES += [
                 'lib/x86_vc/mmxfrag.c',
                 'lib/x86_vc/mmxidct.c',
                 'lib/x86_vc/mmxstate.c',
--- a/media/libvpx/moz.build
+++ b/media/libvpx/moz.build
@@ -89,31 +89,31 @@ if CONFIG['OS_TARGET'] == 'Android':
     # Older versions of the Android NDK don't pre-define anything to indicate
     # the OS they're on, so do it for them.
     DEFINES['__linux__'] = True
 
     SOURCES += [
         '%%%s/sources/android/cpufeatures/cpu-features.c' % CONFIG['ANDROID_NDK'],
     ]
 
-if CONFIG['CLANG_CL'] or not CONFIG['_MSC_VER']:
+if CONFIG['CLANG_CL'] or CONFIG['CC_TYPE'] not in ('msvc', 'clang-cl'):
     for f in SOURCES:
         if f.endswith('.c'):
             if 'sse2.c' in f:
                 SOURCES[f].flags += CONFIG['SSE2_FLAGS']
             if 'ssse3.c' in f:
                 SOURCES[f].flags += ['-mssse3']
             if 'sse4.c' in f:
                 SOURCES[f].flags += ['-msse4.1']
             if 'avx.c' in f:
                 SOURCES[f].flags += ['-mavx']
             if 'avx2.c' in f:
                 SOURCES[f].flags += ['-mavx2']
 
-if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl') and not CONFIG['CLANG_CL']:
     for f in SOURCES:
         if f.endswith('.c'):
             if 'avx.c' in f:
                 SOURCES[f].flags += ['-arch:AVX']
             if 'avx2.c' in f:
                 SOURCES[f].flags += ['-arch:AVX2']
 
 # Suppress warnings in third-party code.
--- a/media/webrtc/moz.build
+++ b/media/webrtc/moz.build
@@ -84,17 +84,17 @@ if CONFIG['MOZ_WEBRTC_SIGNALING']:
         'signaling/src/peerconnection',
         'signaling/src/sdp'
     ]
     GYP_DIRS += ['trunk/third_party/gflags']
     GYP_DIRS['trunk/third_party/gflags'].input = 'trunk/third_party/gflags/gflags.gyp'
     GYP_DIRS['trunk/third_party/gflags'].variables = gyp_vars_copy
     GYP_DIRS['trunk/third_party/gflags'].sandbox_vars['COMPILE_FLAGS'] = {'WARNINGS_AS_ERRORS': []}
 
-    if CONFIG['_MSC_VER']:
+    if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         # Avoid warnings from third-party code that we can not modify.
         if CONFIG['CLANG_CL']:
             CXXFLAGS += ['-Wno-invalid-source-encoding']
         else:
             CXXFLAGS += [
                 '-validate-charset-',
                 '-wd5038', # C5038 initializer list order warnings
             ]
--- a/media/webrtc/signaling/gtest/moz.build
+++ b/media/webrtc/signaling/gtest/moz.build
@@ -35,16 +35,16 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'uiki
     # See Bug 1372950, mediapipeline tests seem to cause crashes on Windows
     if CONFIG['OS_TARGET'] != 'WINNT':
         SOURCES += [
             'mediapipeline_unittest.cpp',
         ]
 
     FINAL_LIBRARY = 'xul-gtest'
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary workaround to enable warning free building
     # with VS2015.
     # reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
     CXXFLAGS += ['-wd4312']
 
     # Disable warning for decorated name length exceeded, name was truncated
     CXXFLAGS += ['-wd4503']
--- a/media/webrtc/trunk/gtest/moz.build
+++ b/media/webrtc/trunk/gtest/moz.build
@@ -559,15 +559,15 @@ if CONFIG['OS_TARGET'] in ['Darwin', 'Li
     if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
         CXXFLAGS += [
             '-Wno-inconsistent-missing-override',
             '-Wno-overloaded-virtual',
         ]
         if CONFIG['CLANG_CXX']:
             CXXFLAGS += ['-Wno-comma']
 
-    if CONFIG['_MSC_VER']:
+    if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         # This is intended as a temporary workaround to enable warning free building
         # with VS2015.
         # reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
         CXXFLAGS += ['-wd4312']
 
     GeckoProgram('webrtc-gtest', linkage=None)
--- a/memory/build/moz.build
+++ b/memory/build/moz.build
@@ -41,15 +41,15 @@ Library('memory')
 if CONFIG['OS_TARGET'] == 'Android' and CONFIG['CC_TYPE'] == 'clang':
     CXXFLAGS += [
         '-Wno-tautological-pointer-compare',
     ]
 
 if CONFIG['MOZ_BUILD_APP'] != 'memory':
     FINAL_LIBRARY = 'mozglue'
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd4273'] # inconsistent dll linkage (bug 558163)
 
 if CONFIG['MOZ_REPLACE_MALLOC_STATIC']:
     DEFINES['MOZ_REPLACE_MALLOC_STATIC'] = True
 
 DisableStlWrapping()
--- a/memory/mozalloc/moz.build
+++ b/memory/mozalloc/moz.build
@@ -9,17 +9,17 @@ EXPORTS.mozilla += [
     'mozalloc.h',
     'mozalloc_abort.h',
     'mozalloc_oom.h',
 ]
 
 if CONFIG['WRAP_STL_INCLUDES']:
     if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
         EXPORTS.mozilla += ['throw_gcc.h']
-    elif CONFIG['_MSC_VER']:
+    elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         DEFINES['_HAS_EXCEPTIONS'] = 0
         if CONFIG['MOZ_MSVC_STL_WRAP_RAISE']:
             SOURCES += [
                 'msvc_raise_wrappers.cpp',
             ]
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     # Keep this file separate to avoid #include'ing windows.h everywhere.
--- a/mfbt/tests/moz.build
+++ b/mfbt/tests/moz.build
@@ -66,17 +66,17 @@ if not CONFIG['MOZ_ASAN']:
         'TestPoisonArea',
     ])
 
 # Since we link directly with MFBT object files, define IMPL_MFBT
 DEFINES['IMPL_MFBT'] = True
 
 DisableStlWrapping()
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
   CXXFLAGS += [
     '-wd4275', # non dll-interface class used as base for dll-interface class
     '-wd4530', # C++ exception handler used, but unwind semantics are not enabled
   ]
 
 USE_LIBS += [
     'mfbt',
 ]
--- a/modules/fdlibm/src/moz.build
+++ b/modules/fdlibm/src/moz.build
@@ -16,17 +16,17 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
         '-Wno-sign-compare',
     ]
 
 if CONFIG['CLANG_CXX']:
     CXXFLAGS += [
         '-Wno-dangling-else',
     ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += [
         '-wd4018', # signed/unsigned mismatch
         '-wd4146', # unary minus operator applied to unsigned type
         '-wd4305', # truncation from 'double' to 'const float'
         '-wd4723', # potential divide by 0
         '-wd4756', # overflow in constant arithmetic
     ]
 
--- a/security/certverifier/moz.build
+++ b/security/certverifier/moz.build
@@ -58,17 +58,17 @@ DIRS += [
     '../pkix',
 ]
 
 TEST_DIRS += [
     'tests/gtest',
 ]
 
 CXXFLAGS += ['-Wall']
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # -Wall with Visual C++ enables too many problematic warnings
     CXXFLAGS += [
         '-wd4355', # 'this' used in base member initializer list
         '-wd4464', # relative include path contains '..'
         '-wd4480', # nonstandard extension used: specifying underlying type for
                    # enum 'enum'
         '-wd4481', # nonstandard extension used: override specifier 'keyword'
         '-wd4510', # default constructor could not be generated
--- a/security/pkix/moz.build
+++ b/security/pkix/moz.build
@@ -33,12 +33,12 @@ include('warnings.mozbuild')
 
 Library('mozillapkix')
 
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary hack to support building with VS2015.
     # declaration of '*' hides class member
     CXXFLAGS += ['-wd4458']
--- a/security/pkix/test/gtest/moz.build
+++ b/security/pkix/test/gtest/moz.build
@@ -53,17 +53,17 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
   if CONFIG['CLANG_CXX']:
     CXXFLAGS += [
       '-Wno-exit-time-destructors',
       '-Wno-global-constructors',
       '-Wno-thread-safety',
       '-Wno-used-but-marked-unused',
       '-Wno-zero-as-null-pointer-constant',
     ]
-elif CONFIG['_MSC_VER']:
+elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
   CXXFLAGS += [
     '-wd4350', # behavior change: 'std::_Wrap_alloc<std::allocator<_Ty>>::...
     '-wd4275', # non dll-interface class used as base for dll-interface class
     '-wd4548', # Expression before comma has no effect
     '-wd4625', # copy constructor could not be generated.
     '-wd4626', # assugment operator could not be generated.
     '-wd4640', # construction of local static object is not thread safe.
 
--- a/security/pkix/warnings.mozbuild
+++ b/security/pkix/warnings.mozbuild
@@ -6,17 +6,17 @@ if CONFIG['CLANG_CXX']:
     '-Wno-c++98-compat-pedantic',
     '-Wno-missing-prototypes',
     '-Wno-missing-variable-declarations',
     '-Wno-padded',
     '-Wno-reserved-id-macro', # NSPR and NSS use reserved IDs in their include guards.
     '-Wno-shadow', # XXX: Clang's rules are too strict for constructors.
     '-Wno-weak-vtables', # We rely on the linker to merge the duplicate vtables.
   ]
-elif CONFIG['_MSC_VER']:
+elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
   CXXFLAGS += [
     '-sdl', # Enable additional security checks based on Microsoft's SDL.
 
     '-Wall',
 
     '-wd4464', # relative include path contains '..'
     '-wd4514', # 'function': unreferenced inline function has been removed
     '-wd4668', # warning C4668: 'X' is not defined as a preprocessor macro,
--- a/security/sandbox/moz.build
+++ b/security/sandbox/moz.build
@@ -166,17 +166,17 @@ elif CONFIG['OS_ARCH'] == 'WINNT':
 
     LOCAL_INCLUDES += ['/security/sandbox/chromium-shim']
     LOCAL_INCLUDES += ['/security/sandbox/chromium']
     LOCAL_INCLUDES += ['/nsprpub']
 
     DisableStlWrapping()
 
     # Suppress warnings in third-party code.
-    if CONFIG['_MSC_VER']:
+    if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         CXXFLAGS += [
             '-wd4275', # non dll-interface class exception used as base for dll-interface class
             '-wd4717', # recursive on all control paths, function will cause runtime stack overflow
             '-wd4996', # 'GetVersionExW': was declared deprecated
             '-wd4302', # 'reinterpret_cast': truncation from 'LPCSTR' to 'WORD'
             '-wd4311', # 'reinterpret_cast': pointer truncation from 'LPOVERLAPPED' to 'DWORD'
             '-wd4312', # 'reinterpret_cast': conversion from 'DWORD' to 'LPOVERLAPPED' of greater size
         ]
--- a/toolkit/components/jsoncpp/src/lib_json/moz.build
+++ b/toolkit/components/jsoncpp/src/lib_json/moz.build
@@ -16,28 +16,28 @@ LOCAL_INCLUDES += [
 
 # This code is only used in the stand-alone minidump analyzer executable so
 # enabling exceptions should be fine.
 if CONFIG['CLANG_CL']:
     CXXFLAGS += [
         '-Xclang',
         '-fcxx-exceptions',
     ]
-elif not CONFIG['_MSC_VER']:
+elif CONFIG['CC_TYPE'] not in ('msvc', 'clang-cl'):
     CXXFLAGS += [
         '-fexceptions',
     ]
 
 # Required to build with exceptions enabled
 DisableStlWrapping()
 
 Library('jsoncpp')
 
 # Suppress warnings in third-party code.
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += [
         '-wd4005', # macro redefinition
     ]
 elif CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += [
         '-Wno-unused-local-typedefs',
         '-Wno-shadow',
     ]
--- a/toolkit/components/maintenanceservice/moz.build
+++ b/toolkit/components/maintenanceservice/moz.build
@@ -27,17 +27,17 @@ DEFINES['NS_NO_XPCOM'] = True
 # Pick up nsWindowsRestart.cpp
 LOCAL_INCLUDES += [
     '/toolkit/mozapps/update/common',
     '/toolkit/xre',
 ]
 
 USE_STATIC_LIBS = True
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 
 RCINCLUDE = 'maintenanceservice.rc'
 
 DisableStlWrapping()
 
 OS_LIBS += [
     'comctl32',
--- a/toolkit/components/protobuf/moz.build
+++ b/toolkit/components/protobuf/moz.build
@@ -131,17 +131,17 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
         '-Wno-unused-function',
     ]
     if CONFIG['CLANG_CXX']:
         CXXFLAGS += [
             '-Wno-comma',
             '-Wno-null-conversion',
             '-Wno-unused-local-typedef',
         ]
-elif CONFIG['_MSC_VER']:
+elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += [
         '-wd4005',  # 'WIN32_LEAN_AND_MEAN' : macro redefinition
         '-wd4018',  # '<' : signed/unsigned mismatch
         '-wd4065',  # switch statement contains 'default' but no 'case' labels
         '-wd4099',  # mismatched class/struct tags
         '-wd4305',  # double to float truncation
         '-wd4506',  # no definition for inline function (protobuf issue #240)
     ]
--- a/toolkit/crashreporter/crashreporter.mozbuild
+++ b/toolkit/crashreporter/crashreporter.mozbuild
@@ -5,17 +5,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 LOCAL_INCLUDES += [
     '/toolkit/crashreporter/breakpad-client',
     '/toolkit/crashreporter/google-breakpad/src',
 ]
 
 # Suppress warnings in third-party code.
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += [
         '-wd4005', # macro redefinition
         '-wd4146', # negative unsigned
         '-wd4334', # 32-bit shift to 64 bits
         '-wd4804', # unsafe use of type 'bool'
     ]
     CFLAGS += [
         '-wd4312', # conversion to greater size
@@ -29,14 +29,14 @@ elif CONFIG['CC_TYPE'] in ('clang', 'gcc
         '-Wno-unused-but-set-variable',
     ]
 
 if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']:
      CXXFLAGS += [
          '-Wno-c++11-narrowing',
      ]
 
-if not CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] not in ('msvc', 'clang-cl'):
      CXXFLAGS += [
          '-Wno-implicit-fallthrough',
      ]
 
 DEFINES['NO_STABS_SUPPORT'] = True
--- a/toolkit/crashreporter/test/moz.build
+++ b/toolkit/crashreporter/test/moz.build
@@ -29,17 +29,17 @@ if CONFIG['OS_TARGET'] == 'WINNT' and CO
         'win64UnwindInfoTests.asm',
     ]
 
 if CONFIG['CLANG_CL']:
     SOURCES['ExceptionThrower.cpp'].flags += [
         '-Xclang',
         '-fcxx-exceptions',
     ]
-elif not CONFIG['_MSC_VER']:
+elif CONFIG['CC_TYPE'] not in ('msvc', 'clang-cl'):
     SOURCES['ExceptionThrower.cpp'].flags += [
         '-fexceptions',
     ]
 
 GeckoSharedLibrary('testcrasher')
 
 DEFINES['SHARED_LIBRARY'] = '%s%s%s' % (
     CONFIG['DLL_PREFIX'],
@@ -50,10 +50,10 @@ DEFINES['SHARED_LIBRARY'] = '%s%s%s' % (
 TEST_HARNESS_FILES.xpcshell.toolkit.crashreporter.test.unit += ['CrashTestUtils.jsm']
 TEST_HARNESS_FILES.xpcshell.toolkit.crashreporter.test.unit_ipc += ['CrashTestUtils.jsm']
 
 include('/toolkit/crashreporter/crashreporter.mozbuild')
 
 NO_PGO = True
 
 # Temporary workaround for an issue in upstream breakpad
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd4334']
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -215,17 +215,17 @@ if CONFIG['MOZ_ANDROID_GOOGLE_VR']:
         '-L%s' % CONFIG['MOZ_ANDROID_GOOGLE_VR_LIBS'],
         '-lgvr',
     ]
 
 OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS']
 OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
 
 if CONFIG['SERVO_TARGET_DIR']:
-    if CONFIG['_MSC_VER']:
+    if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
         OS_LIBS += ['%s/geckoservo' % CONFIG['SERVO_TARGET_DIR']]
     else:
         OS_LIBS += ['-L%s' % CONFIG['SERVO_TARGET_DIR'], '-lgeckoservo']
 
 if CONFIG['MOZ_SYSTEM_JPEG']:
     OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
 
 if CONFIG['MOZ_SYSTEM_PNG']:
--- a/toolkit/mozapps/update/updater/updater-common.build
+++ b/toolkit/mozapps/update/updater/updater-common.build
@@ -104,16 +104,16 @@ LOCAL_INCLUDES += [
 
 DELAYLOAD_DLLS += [
     'crypt32.dll',
     'comctl32.dll',
     'userenv.dll',
     'wsock32.dll',
 ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 elif CONFIG['OS_ARCH'] == 'WINNT':
     WIN32_EXE_LDFLAGS += ['-municode']
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     CXXFLAGS += CONFIG['TK_CFLAGS']
     OS_LIBS += CONFIG['TK_LIBS']
--- a/widget/windows/moz.build
+++ b/widget/windows/moz.build
@@ -139,11 +139,11 @@ for var in ('MOZ_ENABLE_D3D10_LAYER'):
 RESFILE = 'widget.res'
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 
 OS_LIBS += [
     'rpcrt4',
 ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # C5038: Suppress initializer list order warnings from wrl.h
     SOURCES['WindowsUIUtils.cpp'].flags += ['-wd5038']
--- a/xpcom/glue/standalone/moz.build
+++ b/xpcom/glue/standalone/moz.build
@@ -8,17 +8,17 @@ SOURCES += [
     '../FileUtils.cpp',
     'nsXPCOMGlue.cpp',
 ]
 
 Library('xpcomglue')
 
 FORCE_STATIC_LIB = True
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     DEFINES['_USE_ANSI_CPP'] = True
     # Don't include directives about which CRT to use
     CFLAGS += ['-Zl']
     CXXFLAGS += ['-Zl']
 
 DEFINES['XPCOM_GLUE'] = True
 
 LOCAL_INCLUDES += [
--- a/xpcom/io/moz.build
+++ b/xpcom/io/moz.build
@@ -132,13 +132,13 @@ FINAL_LIBRARY = 'xul'
 if CONFIG['OS_ARCH'] == 'Linux' and 'lib64' in CONFIG['libdir']:
     DEFINES['HAVE_USR_LIB64_DIR'] = True
 
 LOCAL_INCLUDES += [
     '!..',
     '../build',
 ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary hack to support building with VS2015.
     # '_snwprintf' : format string '%s' requires an argument of type 'wchar_t *',
     # but variadic argument 3 has type 'char16ptr_t'
     CXXFLAGS += ['-wd4477']
--- a/xpcom/string/moz.build
+++ b/xpcom/string/moz.build
@@ -58,12 +58,12 @@ if CONFIG['INTEL_ARCHITECTURE']:
     SOURCES['nsUTF8UtilsSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
     SOURCES += ['nsReadableUtilsSSE2.cpp']
     SOURCES['nsReadableUtilsSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
 
 # MSVC 2017 has a bug that incorrectly generates C5037 warning which
 # hits the template string code. We need to disable this warning as a
 # workaround. See https://developercommunity.visualstudio.com/
 # content/problem/81223/incorrect-error-c5037-with-permissive.html
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd5037']
 
 FINAL_LIBRARY = 'xul'
--- a/xpcom/typelib/xpt/moz.build
+++ b/xpcom/typelib/xpt/moz.build
@@ -22,17 +22,17 @@ EXPORTS += [
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '!/xpcom/base',
     '/xpcom/base',
 ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CFLAGS += ['-Zl']
 
 # Code with FINAL_LIBRARY = 'xul' shouldn't do this, but the code
 # here doesn't use malloc functions anyways, while not setting
 # MOZ_NO_MOZALLOC makes the code include mozalloc.h, which includes
 # inline operator new definitions that MSVC linker doesn't strip
 # when linking the xpt tests.
 DEFINES['MOZ_NO_MOZALLOC'] = True