Bug 1512504 - Remove support for MSVC. r=froydnj

Consequently, this removes:
- MOZ_LIBPRIO, which is now always enabled.
- non_msvc_compiler, which is now always true.
- The cl.py wrapper, since it's not used anymore.
- CL_INCLUDES_PREFIX, which was only used for the cl.py wrapper.
- NONASCII, which was only there to ensure CL_INCLUDES_PREFIX still
  worked in non-ASCII cases.

This however keeps a large part of detecting and configuring for MSVC,
because we still do need it for at least headers, libraries, and midl.

Depends on D19614

Differential Revision: https://phabricator.services.mozilla.com/D19615

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-02-14 21:45:27 +00:00
Родитель 71158b6626
Коммит ef3ad686ee
92 изменённых файлов: 293 добавлений и 1055 удалений

Просмотреть файл

@ -272,22 +272,15 @@ update-packaging:
package-generated-sources:
$(call py_action,package_generated_sources,'$(DIST)/$(PKG_PATH)$(GENERATED_SOURCE_FILE_PACKAGE)')
#XXX: this is a hack, since we don't want to clobber for MSVC
# PGO support, but we can't do this test in client.mk
# No point in clobbering if PGO has been explicitly disabled.
ifdef NO_PROFILE_GUIDED_OPTIMIZE
maybe_clobber_profiledbuild:
else
ifneq ($(CC_TYPE),msvc)
maybe_clobber_profiledbuild: clean
ifneq (,$(findstring clang,$(CC_TYPE)))
$(LLVM_PROFDATA) merge -o $(DEPTH)/merged.profdata $(DEPTH)/*.profraw
endif
else
maybe_clobber_profiledbuild:
$(RM) $(DIST)/bin/*.pgc
find $(DIST)/$(MOZ_APP_NAME) -name '*.pgc' -exec mv {} $(DIST)/bin \;
endif # msvc
endif # NO_PROFILE_GUIDED_OPTIMIZE
.PHONY: maybe_clobber_profiledbuild

Просмотреть файл

@ -62,7 +62,7 @@ if CONFIG['LIBFUZZER']:
if CONFIG['ENABLE_GECKODRIVER']:
DEFINES['MOZ_GECKODRIVER'] = True
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

Просмотреть файл

@ -1791,16 +1791,14 @@ pref("browser.fission.simulate", false);
// On platforms that do not build libprio, do not set these prefs at all, which gives us a way to detect support.
// Curve25519 public keys for Prio servers
#ifdef MOZ_LIBPRIO
pref("prio.publicKeyA", "35AC1C7576C7C6EDD7FED6BCFC337B34D48CB4EE45C86BEEFB40BD8875707733");
pref("prio.publicKeyB", "26E6674E65425B823F1F1D5F96E3BB3EF9E406EC7FBA7DEF8B08A35DD135AF50");
#endif
// Coverage ping is disabled by default.
pref("toolkit.coverage.enabled", false);
pref("toolkit.coverage.endpoint.base", "https://coverage.mozilla.org");
// Whether or not Prio-encoded Telemetry will be sent along with the main ping.
#if defined(NIGHTLY_BUILD) && defined(MOZ_LIBPRIO)
#if defined(NIGHTLY_BUILD)
pref("prio.enabled", true);
#endif

Просмотреть файл

@ -45,9 +45,6 @@ for cdm in CONFIG['MOZ_EME_MODULES']:
if CONFIG['MOZ_GPSD']:
DEFINES['MOZ_GPSD'] = True
if CONFIG['MOZ_LIBPRIO']:
DEFINES['MOZ_LIBPRIO'] = True
# These files are specified in this moz.build to pick up DIST_SUBDIR as set in
# this directory, which is un-set in browser/app.
JS_PREFERENCE_PP_FILES += [

Просмотреть файл

@ -20,7 +20,7 @@ AC_CACHE_CHECK(what kind of list files are supported by the linker,
dnl https://sourceware.org/bugzilla/show_bug.cgi?id=23600
if AC_TRY_COMMAND(${CC-cc} -o conftest.${OBJ_SUFFIX} -c $MOZ_LTO_CFLAGS $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&5) && test -s conftest.${OBJ_SUFFIX}; then
echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list
if test "$CC_TYPE" = "msvc" -o "$CC_TYPE" = "clang-cl"; then
if test "$CC_TYPE" = "clang-cl"; then
link="$LINKER -OUT:conftest${ac_exeext}"
else
link="${CC-cc} -o conftest${ac_exeext}"

Просмотреть файл

@ -273,7 +273,7 @@ def basic_bindgen_cflags(target, is_unix, compiler_info, android_cflags, clang_p
],
}.get(target.os, [])
if compiler_info.type in ('msvc', 'clang-cl'):
if compiler_info.type == 'clang-cl':
args += [
# To enable the builtin __builtin_offsetof so that CRT wouldn't
# use reinterpret_cast in offsetof() which is not allowed inside

Просмотреть файл

@ -27,7 +27,6 @@ check_headers(
'unistd.h',
'nl_types.h',
'cpuid.h',
when=non_msvc_compiler,
)
# These are all the places some variant of statfs can be hiding.
@ -36,7 +35,6 @@ check_headers(
'sys/statfs.h',
'sys/vfs.h',
'sys/mount.h',
when=non_msvc_compiler,
)
# Quota support
@ -45,7 +43,6 @@ check_headers(
set_define('HAVE_SYS_QUOTA_H',
try_compile(includes=['sys/quota.h'],
body='quotactl(0, nullptr, 0, (caddr_t)nullptr);',
when=non_msvc_compiler,
check_msg='for sys/quota.h'))
check_header('linux/quota.h',
includes=['sys/socket.h'],
@ -59,14 +56,12 @@ check_headers(
when=building_linux,
)
check_header('sys/queue.h',
when=non_msvc_compiler)
check_header('sys/queue.h')
check_headers(
'sys/types.h',
'netinet/in.h',
'byteswap.h',
when=non_msvc_compiler,
)
# TODO: Move these checks to file specific to --enable-project=js.

Просмотреть файл

@ -321,7 +321,7 @@ set_config('WIN64_CARGO_LINKER_CONFIG', win64_cargo_linker_config)
@depends(target, c_compiler, rustc)
@imports('os')
def rustc_natvis_ldflags(target, compiler_info, rustc):
if target.kernel == 'WINNT' and compiler_info.type in ('msvc', 'clang-cl'):
if target.kernel == 'WINNT' and compiler_info.type == 'clang-cl':
sysroot = check_cmd_output(rustc, '--print', 'sysroot').strip()
etc = os.path.join(sysroot, 'lib/rustlib/etc')
ldflags = []

Просмотреть файл

@ -448,14 +448,11 @@ def get_compiler_info(compiler, language):
form of a list or tuple), in the given `language`.
The returned information includes:
- the compiler type (msvc, clang-cl, clang or gcc)
- the compiler type (clang-cl, clang or gcc)
- the compiler version
- the compiler supported language
- the compiler supported language version
'''
# Note: MSVC doesn't expose __STDC_VERSION__. It does expose __STDC__,
# but only when given the -Za option, which disables compiler
# extensions.
# Note: We'd normally do a version check for clang, but versions of clang
# in Xcode have a completely different versioning scheme despite exposing
# the version with the same defines.
@ -469,9 +466,6 @@ def get_compiler_info(compiler, language):
#if defined(__clang__)
%COMPILER "clang-cl"
%VERSION __clang_major__.__clang_minor__.__clang_patchlevel__
#else
%COMPILER "msvc"
%VERSION _MSC_FULL_VER
#endif
#elif defined(__clang__)
%COMPILER "clang"
@ -487,8 +481,6 @@ def get_compiler_info(compiler, language):
%cplusplus __cplusplus
#elif __STDC_VERSION__
%STDC_VERSION __STDC_VERSION__
#elif __STDC__
%STDC_VERSION 198900L
#endif
''')
@ -514,9 +506,9 @@ def get_compiler_info(compiler, language):
# Also check for endianness. The advantage of living in modern times is
# that all the modern compilers we support now have __BYTE_ORDER__ defined
# by the preprocessor, except MSVC, which only supports little endian.
# by the preprocessor.
check += dedent('''\
#if _MSC_VER || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
%ENDIANNESS "little"
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
%ENDIANNESS "big"
@ -549,14 +541,6 @@ def get_compiler_info(compiler, language):
stdc_version = int(data.get('STDC_VERSION', '0L').rstrip('L'))
version = data.get('VERSION')
if version and type == 'msvc':
msc_ver = version
version = msc_ver[0:2]
if len(msc_ver) > 2:
version += '.' + msc_ver[2:4]
if len(msc_ver) > 4:
version += '.' + msc_ver[4:]
if version:
version = Version(version)
@ -604,7 +588,6 @@ def check_compiler(compiler, language, target):
flags.append('-Xclang')
flags.append('-std=gnu99')
# Note: MSVC, while supporting C++14, still reports 199711L for __cplusplus.
# Note: this is a strict version check because we used to always add
# -std=gnu++14.
cxx14_version = 201402
@ -634,7 +617,7 @@ def check_compiler(compiler, language, target):
flags.append('--target=%s' % target.toolchain)
has_target = True
if not has_target and (not info.cpu or info.cpu != target.cpu and info.type != 'msvc'):
if not has_target and (not info.cpu or info.cpu != target.cpu):
same_arch = same_arch_different_bits()
if (target.cpu, info.cpu) in same_arch:
flags.append('-m32')
@ -853,7 +836,7 @@ def default_c_compilers(host_or_target, other_c_compiler=None):
def default_c_compilers(host_or_target, target, toolchain_prefix,
android_clang_compiler, *other_c_compiler):
if host_or_target.kernel == 'WINNT':
supported = types = ('clang-cl', 'msvc', 'gcc', 'clang')
supported = types = ('clang-cl', 'gcc', 'clang')
elif host_or_target.kernel == 'Darwin':
types = ('clang',)
supported = ('clang', 'gcc')
@ -878,10 +861,6 @@ def default_c_compilers(host_or_target, other_c_compiler=None):
# Android NDK clangs do not function as host compiler, so
# prioritize a raw 'clang' instead.
prioritized = info.type
elif info.type == 'msvc' and target.cpu != host_or_target.cpu:
# MSVC compilers only support one architecture, so we'll
# want a cl in another (detected) path.
prioritized = 'cl'
types = [prioritized] + [t for t in types if t != info.type]
@ -898,8 +877,6 @@ def default_c_compilers(host_or_target, other_c_compiler=None):
result.append(android_clang_compiler)
elif type == 'gcc':
result.extend(gcc)
elif type == 'msvc':
result.append('cl')
else:
result.append(type)
@ -1119,16 +1096,6 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
raise FatalCheckError(
'Only clang/llvm 3.9 or newer is supported.')
if info.type == 'msvc':
if info.version < '19.15.26726':
raise FatalCheckError(
'This version (%s) of the MSVC compiler is not '
'supported.\n'
'You must install Visual C++ 2017 Update 8 or '
'later in order to build.\n'
'See https://developer.mozilla.org/en/'
'Windows_Build_Prerequisites' % info.version)
if info.flags:
raise FatalCheckError(
'Unknown compiler or compiler not supported.')
@ -1234,19 +1201,12 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
if value:
return value[0]
@depends(valid_compiler, linker)
def unused_linker(compiler, linker):
if linker and compiler.type != 'msvc':
@depends(linker)
def unused_linker(linker):
if linker:
log.warning('The value of %s is not used by this build system.'
% linker_var)
if host_or_target is target:
@depends(valid_compiler)
def is_msvc(compiler):
return compiler.type == 'msvc'
imply_option('LINKER', linker, reason='LD', when=is_msvc)
return valid_compiler
@ -1258,7 +1218,6 @@ host_cxx_compiler = compiler('C++', host, c_compiler=host_c_compiler,
other_c_compiler=c_compiler)
# Generic compiler-based conditions.
non_msvc_compiler = depends(c_compiler)(lambda info: info.type != 'msvc')
building_with_gcc = depends(c_compiler)(lambda info: info.type == 'gcc')
@ -1266,7 +1225,7 @@ building_with_gcc = depends(c_compiler)(lambda info: info.type == 'gcc')
def msvs_version(info):
# clang-cl emulates the same version scheme as cl. And MSVS_VERSION needs to
# be set for GYP on Windows.
if info.type in ('clang-cl', 'msvc'):
if info.type == 'clang-cl':
return '2017'
return ''
@ -1289,7 +1248,7 @@ def check_have_64_bit(have_64_bit, compiler_have_64_bit):
@depends(c_compiler, target)
def default_debug_flags(compiler_info, target):
# Debug info is ON by default.
if compiler_info.type in ('msvc', 'clang-cl'):
if compiler_info.type == 'clang-cl':
return '-Z7'
elif target.kernel == 'WINNT' and compiler_info.type == 'clang':
return '-g -gcodeview'
@ -1427,11 +1386,11 @@ set_config('WRAP_SYSTEM_INCLUDES', wrap_system_includes)
set_config('VISIBILITY_FLAGS', visibility_flags)
@depends(c_compiler, using_sccache)
def depend_cflags(info, using_sccache):
if info.type not in ('clang-cl', 'msvc'):
@depends(c_compiler)
def depend_cflags(info):
if info.type != 'clang-cl':
return ['-MD', '-MP', '-MF $(MDDEPDIR)/$(@F).pp']
elif info.type == 'clang-cl':
else:
# clang-cl doesn't accept the normal -MD -MP -MF options that clang
# does, but the underlying cc1 binary understands how to generate
# dependency files. These options are based on analyzing what the
@ -1444,10 +1403,6 @@ def depend_cflags(info, using_sccache):
'-Xclang', '-MT',
'-Xclang', '$@'
]
elif using_sccache:
# sccache supports a special flag to create depfiles
# by parsing MSVC's -showIncludes output.
return ['-deps$(MDDEPDIR)/$(@F).pp']
set_config('_DEPEND_CFLAGS', depend_cflags)
@ -1492,29 +1447,6 @@ def pgo_flags(compiler, build_env, target):
use_ldflags=[],
)
if compiler.type == 'msvc':
num_cores = min(8, multiprocessing.cpu_count())
cgthreads = '-CGTHREADS:%s' % num_cores
return namespace(
gen_cflags=['-GL'],
gen_ldflags=['-LTCG:PGINSTRUMENT', '-PogoSafeMode', cgthreads],
# XXX: PGO builds can fail with warnings treated as errors,
# specifically "no profile data available" appears to be
# treated as an error sometimes. This might be a consequence
# of using WARNINGS_AS_ERRORS in some modules, combined
# with the linker doing most of the work in the whole-program
# optimization/PGO case. I think it's probably a compiler bug,
# but we work around it here.
use_cflags=['-GL', '-wd4624', '-wd4952'],
# XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
# Probably also a compiler bug, but what can you do?
# /d2:-cgsummary prints a summary of what is happening during
# code generation. How long individual functions are optimized,
# which functions are optimized, etc.
use_ldflags=['-LTCG:PGUPDATE', cgthreads, '-d2:-cgsummary'],
)
set_config('PROFILE_GEN_CFLAGS', pgo_flags.gen_cflags)
set_config('PROFILE_GEN_LDFLAGS', pgo_flags.gen_ldflags)
@ -2069,7 +2001,7 @@ js_option(env='AS', nargs=1, help='Path to the assembler')
@depends(target, c_compiler)
def as_info(target, c_compiler):
if c_compiler.type in ('msvc', 'clang-cl'):
if c_compiler.type == 'clang-cl':
ml = {
'x86': 'ml',
'x86_64': 'ml64',
@ -2079,7 +2011,7 @@ def as_info(target, c_compiler):
type='masm',
names=(ml, )
)
# When building with anything but MSVC, we just use the C compiler as the assembler.
# When building with anything but clang-cl, we just use the C compiler as the assembler.
return namespace(
type='gcc',
names=(c_compiler.compiler, )

Просмотреть файл

@ -251,13 +251,10 @@ def valid_ucrt_sdk_dir(windows_sdk_dir, windows_sdk_dir_env, c_compiler):
@depends(c_compiler, toolchain_search_path)
@imports('os')
def vc_path(c_compiler, toolchain_search_path):
if c_compiler.type not in ('msvc', 'clang-cl'):
if c_compiler.type != 'clang-cl':
return
vc_program = c_compiler.compiler
# In clang-cl builds, we use the headers and libraries from an MSVC installation.
if c_compiler.type == 'clang-cl':
# In clang-cl builds, we need the headers and libraries from an MSVC installation.
vc_program = find_program('cl.exe', paths=toolchain_search_path)
if not vc_program:
die('Cannot find a Visual C++ install for e.g. ATL headers.')
@ -487,65 +484,17 @@ def valid_mt(path):
set_config('MSMANIFEST_TOOL', depends(valid_mt)(lambda x: bool(x)))
@template
def linker_progs_for(host_or_target):
compiler = {
host: host_c_compiler,
target: c_compiler,
}[host_or_target]
@depends(compiler)
def linker_progs(compiler):
if compiler.type == 'msvc':
return ('link', 'lld-link')
if compiler.type == 'clang-cl':
return ('lld-link', 'link')
return linker_progs
js_option(env='LINKER', nargs=1, help='Path to the linker')
link = check_prog('LINKER', linker_progs_for(target), input='LINKER',
link = check_prog('LINKER', ('lld-link',), input='LINKER',
paths=toolchain_search_path)
js_option(env='HOST_LINKER', nargs=1, help='Path to the host linker')
host_link = check_prog('HOST_LINKER', linker_progs_for(host),
input='HOST_LINKER',
host_link = check_prog('HOST_LINKER', ('lld-link',), input='HOST_LINKER',
paths=host_toolchain_search_path)
add_old_configure_assignment('LINKER', link)
check_prog('MAKECAB', ('makecab.exe',))
@depends(c_compiler, using_sccache)
def need_showincludes_prefix(info, using_sccache):
# sccache does its own -showIncludes prefix checking.
# clang-cl uses a gcc-style dependency scheme, see toolchain.configure.
if info.type == 'msvc' and not using_sccache:
return True
@depends(c_compiler, when=need_showincludes_prefix)
@imports(_from='re', _import='compile', _as='re_compile')
def msvc_showincludes_prefix(c_compiler):
pattern = re_compile(br'^([^:]*:.*[ :] )(.*\\stdio.h)$')
output = try_invoke_compiler([c_compiler.compiler], 'C', '#include <stdio.h>\n',
['-nologo', '-c', '-Fonul', '-showIncludes'])
for line in output.splitlines():
if line.endswith(b'\\stdio.h'):
m = pattern.match(line)
if m:
return m.group(1)
# We should have found the prefix and returned earlier
die('Cannot find cl -showIncludes prefix.')
set_config('CL_INCLUDES_PREFIX', msvc_showincludes_prefix)
# Make sure that the build system can handle non-ASCII characters in
# environment variables to prevent silent breakage on non-English systems.
set_config('NONASCII', b'\241\241')

Просмотреть файл

@ -159,7 +159,7 @@ def NoVisibilityFlags():
@template
def ForceInclude(*headers):
"""Force includes a set of header files in C++ compilations"""
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
include_flag = '-FI'
else:
include_flag = '-include'

Просмотреть файл

@ -106,14 +106,6 @@ VERSION_NUMBER = 50
CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
AUTOCONF_TOOLS = $(MOZILLA_DIR)/build/autoconf
ifeq (msvc,$(CC_TYPE))
# clang-cl is smart enough to generate dependencies directly.
ifeq (,$(MOZ_USING_SCCACHE))
CC_WRAPPER ?= $(call py_action,cl)
CXX_WRAPPER ?= $(call py_action,cl)
endif # MOZ_USING_SCCACHE
endif # CC_TYPE
CC := $(CC_WRAPPER) $(CC)
CXX := $(CXX_WRAPPER) $(CXX)
MKDIR ?= mkdir
@ -441,9 +433,3 @@ endif
endif
PLY_INCLUDE = -I$(MOZILLA_DIR)/other-licenses/ply
export CL_INCLUDES_PREFIX
# Make sure that the build system can handle non-ASCII characters
# in environment variables to prevent it from breking silently on
# non-English systems.
export NONASCII

11
config/external/icu/defs.mozbuild поставляемый
Просмотреть файл

@ -49,14 +49,3 @@ if CONFIG['CC_TYPE'] == 'clang-cl':
'-Wno-macro-redefined',
'-Wno-microsoft-include',
]
if CONFIG['CC_TYPE'] == 'msvc':
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.
]

1
config/external/moz.build поставляемый
Просмотреть файл

@ -13,7 +13,6 @@ DIRS += [
if not CONFIG['MOZ_SYSTEM_JPEG']:
external_dirs += ['media/libjpeg']
if CONFIG['MOZ_LIBPRIO']:
DIRS += [
'prio',
]

2
config/external/msgpack/moz.build поставляемый
Просмотреть файл

@ -4,6 +4,4 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['MOZ_LIBPRIO']:
DIRS += ['/third_party/msgpack']

Просмотреть файл

@ -43,7 +43,7 @@ if CONFIG['WRAP_STL_INCLUDES']:
stl_compiler = None
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
stl_compiler = 'gcc'
elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
elif CONFIG['CC_TYPE'] == 'clang-cl':
stl_compiler = 'msvc'
if stl_compiler:

Просмотреть файл

@ -359,7 +359,7 @@ else
# Windows-to-Windows cross compiles should always use MSVC-style options for
# host compiles.
ifeq (WINNT_WINNT,$(HOST_OS_ARCH)_$(OS_ARCH))
ifneq (,$(filter-out msvc clang-cl,$(HOST_CC_TYPE)))
ifneq (,$(filter-out clang-cl,$(HOST_CC_TYPE)))
$(error MSVC-style compilers should be used for host compilations!)
endif
HOST_OUTOPTION = -Fo# eol
@ -517,13 +517,6 @@ define EXPAND_CC_OR_CXX
$(if $(PROG_IS_C_ONLY_$(1)),$(CC),$(CCC))
endef
# Workaround a bug of MSVC 2017 Update 8 (see bug 1485224)
ifeq ($(CC_TYPE)_$(HOST_OS_ARCH)_$(MOZ_PROFILE_GENERATE),msvc_WINNT_1)
LINKER_OUT=$(subst /,\,$1)
else
LINKER_OUT=$1
endif
#
# PROGRAM = Foo
# creates OBJS, links with LIBS to create Foo
@ -532,7 +525,7 @@ $(PROGRAM): $(PROGOBJS) $(STATIC_LIBS) $(RUST_STATIC_LIB) $(EXTRA_DEPS) $(RESFIL
$(REPORT_BUILD)
@$(RM) $@.manifest
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
$(LINKER) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $($(notdir $@)_$(OBJS_VAR_SUFFIX)) $(RESFILE) $(STATIC_LIBS) $(RUST_STATIC_LIB) $(SHARED_LIBS) $(OS_LIBS)
$(LINKER) -NOLOGO -OUT:$@ -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $($(notdir $@)_$(OBJS_VAR_SUFFIX)) $(RESFILE) $(STATIC_LIBS) $(RUST_STATIC_LIB) $(SHARED_LIBS) $(OS_LIBS)
ifdef MSMANIFEST_TOOL
@if test -f $@.manifest; then \
if test -f '$(srcdir)/$(notdir $@).manifest'; then \
@ -659,7 +652,7 @@ endif
$(HOST_SHARED_LIBRARY): Makefile
$(REPORT_BUILD)
$(RM) $@
ifneq (,$(filter msvc clang-cl,$(HOST_CC_TYPE)))
ifneq (,$(filter clang-cl,$(HOST_CC_TYPE)))
$(HOST_LINKER) -NOLOGO -DLL -OUT:$@ $($(notdir $@)_OBJS) $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LINKER_LIBPATHS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
$(HOST_CXX) $(HOST_OUTOPTION)$@ $($(notdir $@)_OBJS) $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)

Просмотреть файл

@ -7,9 +7,6 @@
with Files("**"):
BUG_COMPONENT = ("Core", "DOM")
if CONFIG['CC_TYPE'] == 'msvc':
CXXFLAGS += ['-bigobj']
TEST_DIRS += ['test']
XPIDL_SOURCES += [
@ -98,7 +95,6 @@ LOCAL_INCLUDES += [
'/media/webrtc/trunk/',
]
if CONFIG['MOZ_LIBPRIO']:
LOCAL_INCLUDES += ['/third_party/msgpack/include']
DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True

Просмотреть файл

@ -69,7 +69,6 @@ if CONFIG['MOZ_PLACES']:
'PlacesObservers.webidl',
]
if CONFIG['MOZ_LIBPRIO']:
WEBIDL_FILES += [
'PrioEncoder.webidl',
]

Просмотреть файл

@ -304,7 +304,6 @@ SOURCES += [
# Some codec-related code uses multi-character constants, which GCC and clang
# warn about. Suppress turning this warning into an error.
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
SOURCES['DecoderTraits.cpp'].flags += ['-Wno-error=multichar']
EXTRA_COMPONENTS += [

Просмотреть файл

@ -41,7 +41,7 @@ SOURCES += [
FINAL_LIBRARY = 'xul'
# Supress warnnings for now.
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
CFLAGS += [
'-wd4013', # 'function' undefined; assuming extern returning int
'-wd4101', # unreferenced local variable

Просмотреть файл

@ -26,7 +26,7 @@ LOCAL_INCLUDES += [
FINAL_LIBRARY = 'xul'
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
CFLAGS += [
'-wd4013', # 'function' undefined; assuming extern returning int
'-wd4101', # unreferenced local variable

Просмотреть файл

@ -34,7 +34,7 @@ if CONFIG['CC_TYPE'] == 'clang':
CXXFLAGS += [
'-Wno-unknown-attributes',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-wd4996', # deprecated declaration
]

Просмотреть файл

@ -31,9 +31,6 @@ FINAL_LIBRARY = 'xul'
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
# Avoid warnings from third-party code that we can not modify.
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += ['-Wno-invalid-source-encoding']
else:
CXXFLAGS += ['-validate-charset-']

Просмотреть файл

@ -48,7 +48,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
UNIFIED_SOURCES += ['OSXRunLoopSingleton.cpp']
EXPORTS += ['OSXRunLoopSingleton.h']
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
DEFINES['__PRETTY_FUNCTION__'] = '__FUNCSIG__'
# This is intended as a temporary workaround to enable building with VS2015.

Просмотреть файл

@ -77,7 +77,6 @@ include('/ipc/chromium/chromium-config.mozbuild')
# - about attributes on forward declarations for types that are already
# defined, which complains about important MOZ_EXPORT attributes for
# android API types
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CXXFLAGS += [
'-Wno-error=attributes',
'-Wno-error=shadow',
@ -86,7 +85,7 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
DEFINES['TRACING'] = True
FINAL_LIBRARY = 'xul'
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == '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

Просмотреть файл

@ -104,11 +104,9 @@ DIRS += [
'simpledb',
'reporting',
'localstorage',
'prio',
]
if CONFIG['MOZ_LIBPRIO']:
DIRS += ['prio']
if CONFIG['OS_ARCH'] == 'WINNT':
DIRS += ['plugins/ipc/hangui']

Просмотреть файл

@ -148,7 +148,7 @@ CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == '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']

Просмотреть файл

@ -55,7 +55,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
OS_LIBS += CONFIG['XLIBS']
OS_LIBS += CONFIG['XEXT_LIBS']
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == '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']

Просмотреть файл

@ -210,7 +210,6 @@ if CONFIG['MOZ_TREE_FREETYPE']:
DEFINES['FT_LCD_FILTER_H'] = '%s/modules/freetype2/include/freetype/ftlcdfil.h' % TOPSRCDIR
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CFLAGS += [
'-Wno-enum-compare',
'-Wno-int-to-pointer-cast',
@ -240,26 +239,6 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
else:
CFLAGS += ['-Wno-unused-but-set-variable']
if CONFIG['CC_TYPE'] == 'msvc':
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'
'-wd4477', # format string '%s' requires an argument of type 'type'
'-wd4996', # The compiler encountered a deprecated declaration.
]
CXXFLAGS += [
'-wd4005', # 'WIN32_LEAN_AND_MEAN' : macro redefinition
'-wd4018', # '>' : signed/unsigned mismatch
'-wd4146', # unary minus operator applied to unsigned type
'-wd4828', # illegal in the current source character set
'-wd4838', # requires a narrowing conversion
]
# See bug 386897.
if CONFIG['CC_TYPE'] in ('clang', 'gcc') and CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_OPTIMIZE']:
CFLAGS += ['-O2']

Просмотреть файл

@ -85,7 +85,7 @@ use_arm_neon_gcc = False
if CONFIG['INTEL_ARCHITECTURE']:
use_sse2 = True
if CONFIG['CPU_ARCH'] == 'x86':
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
use_mmx = True
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
use_mmx = True
@ -150,7 +150,6 @@ if CONFIG['OS_TARGET'] == 'Android' and (use_arm_neon_gcc or use_arm_simd_gcc):
]
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CFLAGS += [
'-Wno-address',
'-Wno-missing-field-initializers',
@ -168,14 +167,6 @@ if CONFIG['CC_TYPE'] == 'clang-cl':
CFLAGS += [
'-Wno-unused-variable',
]
if CONFIG['CC_TYPE'] == 'msvc':
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'
]
# See bug 386897.
if CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_OPTIMIZE']:

Просмотреть файл

@ -27,7 +27,7 @@ use_sse2 = False
use_altivec = False
if CONFIG['INTEL_ARCHITECTURE']:
use_sse2 = True
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
if CONFIG['OS_ARCH'] != 'WINNT' or CONFIG['CPU_ARCH'] != 'x86_64':
use_sse1 = True
else:

Просмотреть файл

@ -24,7 +24,7 @@ header = """
skia_opt_flags = []
if CONFIG['MOZ_OPTIMIZE']:
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
skia_opt_flags += ['-O2']
elif CONFIG['CC_TYPE'] in ('clang', 'gcc'):
skia_opt_flags += ['-O3']
@ -79,7 +79,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
# We should autogenerate these SSE related flags.
if CONFIG['INTEL_ARCHITECTURE'] and (CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc')):
if CONFIG['INTEL_ARCHITECTURE']:
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']
@ -88,17 +88,6 @@ if CONFIG['INTEL_ARCHITECTURE'] and (CONFIG['CC_TYPE'] in ('clang', 'clang-cl',
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', '-mf16c', '-mfma']
elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl') and CONFIG['INTEL_ARCHITECTURE']:
# 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']
SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=51']
SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=52']
elif CONFIG['CPU_ARCH'] == 'arm' and CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += CONFIG['NEON_FLAGS']
elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'):
@ -116,7 +105,6 @@ if CONFIG['MOZ_TREE_FREETYPE']:
DEFINES['SK_CAN_USE_DLOPEN'] = 0
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CXXFLAGS += [
'-Wno-deprecated-declarations',
'-Wno-overloaded-virtual',
@ -456,7 +444,7 @@ def write_mozbuild(sources):
write_sources(f, sources['arm'], 4)
write_cflags(f, sources['arm'], opt_whitelist, 'skia_opt_flags', 4)
f.write("elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang-cl', 'clang', 'gcc'):\n")
f.write("elif CONFIG['CPU_ARCH'] == 'aarch64':\n")
write_sources(f, sources['arm64'], 4)
write_cflags(f, sources['arm64'], opt_whitelist, 'skia_opt_flags', 4)

Просмотреть файл

@ -17,7 +17,7 @@
skia_opt_flags = []
if CONFIG['MOZ_OPTIMIZE']:
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
skia_opt_flags += ['-O2']
elif CONFIG['CC_TYPE'] in ('clang', 'gcc'):
skia_opt_flags += ['-O3']
@ -686,7 +686,7 @@ elif CONFIG['CPU_ARCH'] == 'arm' and CONFIG['CC_TYPE'] in ('clang', 'gcc'):
SOURCES['skia/src/opts/SkBlitMask_opts_arm_neon.cpp'].flags += skia_opt_flags
SOURCES['skia/src/opts/SkBlitRow_opts_arm.cpp'].flags += skia_opt_flags
SOURCES['skia/src/opts/SkBlitRow_opts_arm_neon.cpp'].flags += skia_opt_flags
elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang-cl', 'clang', 'gcc'):
elif CONFIG['CPU_ARCH'] == 'aarch64':
SOURCES += [
'skia/src/opts/SkBitmapProcState_arm_neon.cpp',
'skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
@ -759,7 +759,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
# We should autogenerate these SSE related flags.
if CONFIG['INTEL_ARCHITECTURE'] and (CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc')):
if CONFIG['INTEL_ARCHITECTURE']:
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']
@ -768,17 +768,6 @@ if CONFIG['INTEL_ARCHITECTURE'] and (CONFIG['CC_TYPE'] in ('clang', 'clang-cl',
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', '-mf16c', '-mfma']
elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl') and CONFIG['INTEL_ARCHITECTURE']:
# 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']
SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=51']
SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-DSK_CPU_SSE_LEVEL=52']
elif CONFIG['CPU_ARCH'] == 'arm' and CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += CONFIG['NEON_FLAGS']
elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'):
@ -796,7 +785,6 @@ if CONFIG['MOZ_TREE_FREETYPE']:
DEFINES['SK_CAN_USE_DLOPEN'] = 0
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CXXFLAGS += [
'-Wno-deprecated-declarations',
'-Wno-overloaded-virtual',

Просмотреть файл

@ -40,7 +40,7 @@ if CONFIG['OS_TARGET'] in ('WINNT', 'Linux', 'Darwin'):
FINAL_LIBRARY = 'xul'
# This is intended as a temporary hack to enable VS2015 builds.
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
# ovr_capi_dynamic.h '<unnamed-tag>': Alignment specifier is less than
# actual alignment (8), and will be ignored
CXXFLAGS += ['-wd4359']

Просмотреть файл

@ -24,7 +24,7 @@ if CONFIG['INTEL_ARCHITECTURE']:
SOURCES['yuv_convert_sse2.cpp'].flags += CONFIG['SSE2_FLAGS']
# MSVC doesn't support MMX when targeting AMD64.
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
if CONFIG['CPU_ARCH'] == 'x86':
SOURCES += [
'yuv_convert_mmx.cpp',
@ -33,7 +33,7 @@ if CONFIG['INTEL_ARCHITECTURE']:
SOURCES += ['yuv_convert_mmx.cpp']
SOURCES['yuv_convert_mmx.cpp'].flags += CONFIG['MMX_FLAGS']
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
if CONFIG['CPU_ARCH'] == 'x86_64' or \
(CONFIG['CPU_ARCH'] == 'x86' and CONFIG['CC_TYPE'] == 'clang-cl'):
SOURCES += [

Просмотреть файл

@ -59,7 +59,7 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_TARGET'] == 'Darwin':
'mozsandbox',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

Просмотреть файл

@ -31,7 +31,7 @@ if CONFIG['OS_ARCH'] == 'WINNT':
'WIN32_LEAN_AND_MEAN': True,
})
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
DEFINES['COMPILER_MSVC'] = True
else:

Просмотреть файл

@ -189,7 +189,7 @@ else:
'GeckoChildProcessHost.cpp',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == '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']

Просмотреть файл

@ -16,5 +16,5 @@ LOCAL_INCLUDES += [
'/xpcom/base',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

Просмотреть файл

@ -7,7 +7,7 @@
# ICU pkg-config flags
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
# C4805 warns mixing bool with other integral types in computation.
# But given the conversion from bool is specified, and this is a
# pattern widely used in code in js/src, suppress this warning here.

Просмотреть файл

@ -393,7 +393,6 @@ if CONFIG['MOZ_VTUNE']:
'vtune/jitprofiling.c',
'vtune/VTuneWrapper.cpp',
]
if CONFIG['CC_TYPE'] != 'msvc':
SOURCES['vtune/ittnotify_static.c'].flags += ['-Wno-varargs', '-Wno-unknown-pragmas']
if CONFIG['HAVE_LINUX_PERF_EVENT_H']:

Просмотреть файл

@ -26,12 +26,6 @@ UNIFIED_SOURCES += [
DEFINES['EXPORT_JS_API'] = True
if CONFIG['CC_TYPE'] == 'msvc':
# PGO is unnecessary for the js shell, but clang/gcc cannot turn off PGO
# because we need to resolve symbols from PGO runtime library when our
# object files have been compiled for PGO.
NO_PGO = True
LOCAL_INCLUDES += [
'!..',
'..',

Просмотреть файл

@ -21,7 +21,7 @@ LOCAL_INCLUDES += [
'/toolkit/xre',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

Просмотреть файл

@ -22,7 +22,7 @@ SOURCES += [
]
# warning C4661 for FilteringWrapper
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-wd4661', # no suitable definition provided for explicit template instantiation request
]

Просмотреть файл

@ -165,7 +165,7 @@ MARIONETTE_LAYOUT_MANIFESTS += ['tests/marionette/manifest.ini']
MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
MOCHITEST_CHROME_MANIFESTS += ['tests/chrome/chrome.ini']
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == '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']

Просмотреть файл

@ -68,7 +68,7 @@ FINAL_LIBRARY = 'xul'
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == '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']

Просмотреть файл

@ -227,11 +227,6 @@ SOURCES += [
# windows.h.
'nsLayoutStylesheetCache.cpp',
]
if CONFIG['CC_TYPE'] == 'msvc':
# Needed for gCSSAnonBoxAtoms.
SOURCES['nsCSSAnonBoxes.cpp'].flags += ['-Zc:externConstexpr']
# Needed for gCSSPseudoElementAtoms.
SOURCES['nsCSSPseudoElements.cpp'].flags += ['-Zc:externConstexpr']
include('/ipc/chromium/chromium-config.mozbuild')

Просмотреть файл

@ -29,7 +29,6 @@ LOCAL_INCLUDES += ['/media/ffvpx']
AllowCompilerWarnings()
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CFLAGS += [
'-Wno-parentheses',
'-Wno-pointer-sign',
@ -65,35 +64,7 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
# Force visibility of cpu and av_log symbols.
CFLAGS += ['-include', 'libavutil_visibility.h']
elif CONFIG['CC_TYPE'] == 'msvc':
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
'-wd4756', # overflow in constant arithmetic
'-wd4005', #'WIN32_LEAN_AND_MEAN' : macro redefinition
'-wd4054', # 'type cast' : from function pointer 'FARPROC' to data pointer 'void *'
'-wd4189', # local variable is initialized but not referenced
'-wd4133', # 'function' : incompatible types - from 'AVSampleFormat *' to 'int *'
'-wd4221', # nonstandard extension used
'-wd4206', # nonstandard extension used
'-wd4702', # unreachable code
'-wd4101', # unreferenced local variable
'-wd4245', # conversion from 'int' to 'uint32_t', signed/unsigned mismatch
'-wd4703', # potentially uninitialized local pointer
'-wd4293', # '<<' : shift count negative or too big, undefined behavior
'-wd4334', # '<<' : result of 32-bit shift implicitly converted to 64 bits
'-wd4996', # The compiler encountered a deprecated declaration.
# from FFmpeg configure
'-wd4244', '-wd4127', '-wd4018', '-wd4389', '-wd4146', '-wd4701',
'-wd4057', '-wd4204', '-wd4706', '-wd4305', '-wd4152', '-wd4324',
'-we4013', '-wd4100', '-wd4214', '-wd4307', '-wd4273', '-wd4554',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
LOCAL_INCLUDES += ['/media/ffvpx/compat/atomics/win32']
DEFINES['HAVE_AV_CONFIG_H'] = True

Просмотреть файл

@ -58,23 +58,18 @@ DEFINES['MOZ_NO_MOZALLOC'] = True
USE_LIBS += ['psshparser']
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CFLAGS += [
'-Wno-missing-braces',
'-Wno-pointer-to-int-cast',
'-Wno-sign-compare',
]
elif CONFIG['CC_TYPE'] == 'msvc':
CFLAGS += [
'-wd4090', # '=' : different 'const' qualifiers
]
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CFLAGS += [
'-include', 'stdio.h', # for sprintf() prototype
'-include', 'unistd.h', # for getpid() prototype
]
elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
elif CONFIG['CC_TYPE'] == 'clang-cl':
CFLAGS += [
'-FI', 'stdio.h', # for sprintf() prototype
]

Просмотреть файл

@ -99,7 +99,6 @@ if CONFIG['OS_TARGET'] == 'Android':
'%%%s/sources/android/cpufeatures/cpu-features.c' % CONFIG['ANDROID_NDK'],
]
if CONFIG['CC_TYPE'] != 'msvc':
for f in SOURCES:
if f.endswith('sse2.c'):
SOURCES[f].flags += CONFIG['SSE2_FLAGS']
@ -114,15 +113,7 @@ if CONFIG['CC_TYPE'] != 'msvc':
elif f.endswith('avx2.c'):
SOURCES[f].flags += ['-mavx2']
if CONFIG['CC_TYPE'] == 'msvc' and CONFIG['INTEL_ARCHITECTURE']:
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', 'clang-cl', 'gcc'):
CFLAGS += [
'-Wno-sign-compare',
'-Wno-unused-function', # so many of these warnings; just ignore them

Просмотреть файл

@ -72,7 +72,7 @@ if CONFIG['OS_TARGET'] == 'WINNT':
OS_LIBS += [
"avrt",
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += ['-wd4005'] # C4005: '_USE_MATH_DEFINES' : macro redefinition
if CONFIG['OS_TARGET'] == 'Android':

Просмотреть файл

@ -159,11 +159,6 @@ if CONFIG['OS_TARGET'] == 'WINNT':
'../../third_party/dav1d/src/win32/thread.c'
]
if CONFIG['CC_TYPE'] == 'msvc':
LOCAL_INCLUDES += ['../../third_party/dav1d/include/compat/msvc/']
EXPORTS.dav1d += ['../../third_party/dav1d/include/compat/msvc/stdatomic.h']
CFLAGS += ['-wd4028']
if CONFIG['CC_TYPE'] == 'gcc':
LOCAL_INCLUDES += ['../../third_party/dav1d/include/compat/gcc/']
EXPORTS.dav1d += ['../../third_party/dav1d/include/compat/gcc/stdatomic.h']

Просмотреть файл

@ -99,7 +99,6 @@ if CONFIG['CPU_ARCH'] in ('x86', 'x86_64'):
SOURCES += silk_sources_sse4_1
if not CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
SOURCES += silk_sources_fixed_sse4_1
if CONFIG['CC_TYPE'] != 'msvc':
for f in SOURCES:
if f in celt_sources_sse:
SOURCES[f].flags += CONFIG['SSE_FLAGS']

Просмотреть файл

@ -49,9 +49,3 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']:
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CFLAGS += ['-Wno-sign-compare']
if CONFIG['CC_TYPE'] == 'msvc':
CFLAGS += [
'-wd4018', # '<' : signed/unsigned mismatch
'-wd4101', # unreferenced local variable
]

Просмотреть файл

@ -22,7 +22,6 @@ FINAL_LIBRARY = 'gkmedias'
DEFINES['THEORA_DISABLE_ENCODE'] = True
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CFLAGS += ['-Wno-type-limits']
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
CFLAGS += ['-Wno-tautological-compare']
@ -58,18 +57,16 @@ if CONFIG['INTEL_ARCHITECTURE']:
DEFINES['OC_X86_ASM'] = True
if CONFIG['CPU_ARCH'] == 'x86_64':
DEFINES['OC_X86_64_ASM'] = True
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
# clang-cl can't handle libtheora's inline asm.
pass
elif CONFIG['CPU_ARCH'] == 'x86':
SOURCES += [
'lib/x86_vc/mmxfrag.c',
'lib/x86_vc/mmxidct.c',
'lib/x86_vc/mmxstate.c',
'lib/x86_vc/x86cpu.c',
'lib/x86_vc/x86state.c',
]
#SOURCES += [
# 'lib/x86_vc/mmxfrag.c',
# 'lib/x86_vc/mmxidct.c',
# 'lib/x86_vc/mmxstate.c',
# 'lib/x86_vc/x86cpu.c',
# 'lib/x86_vc/x86state.c',
#]
else:
SOURCES += [
'lib/x86/mmxfrag.c',

Просмотреть файл

@ -109,7 +109,6 @@ if CONFIG['OS_TARGET'] == 'Android':
'%%%s/sources/android/cpufeatures/cpu-features.c' % CONFIG['ANDROID_NDK'],
]
if CONFIG['CC_TYPE'] != 'msvc':
for f in SOURCES:
if f.endswith('.c'):
if 'sse2.c' in f:
@ -123,16 +122,7 @@ if CONFIG['CC_TYPE'] != 'msvc':
if 'avx2.c' in f:
SOURCES[f].flags += ['-mavx2']
if CONFIG['CC_TYPE'] == 'msvc' and CONFIG['INTEL_ARCHITECTURE']:
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.
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CFLAGS += [
'-Wno-sign-compare',
'-Wno-unused-function', # so many of these warnings; just ignore them

Просмотреть файл

@ -36,7 +36,7 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']:
for f in SOURCES:
if f.endswith('neon.c'):
SOURCES[f].flags += CONFIG['NEON_FLAGS']
elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] != 'msvc':
elif CONFIG['CPU_ARCH'] == 'aarch64':
SOURCES += [
'alpha_processing_neon.c',
'dec_neon.c',

Просмотреть файл

@ -101,15 +101,9 @@ if CONFIG['MOZ_WEBRTC_SIGNALING']:
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['CC_TYPE'] in ('msvc', 'clang-cl'):
# Avoid warnings from third-party code that we can not modify.
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += ['-Wno-invalid-source-encoding']
else:
CXXFLAGS += [
'-validate-charset-',
'-wd5038', # C5038 initializer list order warnings
]
if CONFIG['ENABLE_TESTS']:
TEST_DIRS += [

Просмотреть файл

@ -42,7 +42,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'uikit' and CONFIG['OS_TARGET'] != 'Android':
FINAL_LIBRARY = 'xul-gtest'
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == '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

Просмотреть файл

@ -481,7 +481,7 @@ if CONFIG['OS_TARGET'] in ['Darwin', 'Linux', 'WINNT']:
if CONFIG['CC_TYPE'] == 'clang':
CXXFLAGS += ['-Wno-comma']
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == '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

Просмотреть файл

@ -22,7 +22,7 @@ if CONFIG['MOZ_WEBRTC']:
elif CONFIG['OS_TARGET'] == 'Android':
DEFINES['WEBRTC_ANDROID'] = True
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
DEFINES['__PRETTY_FUNCTION__'] = '__FUNCSIG__'
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):

Просмотреть файл

@ -46,7 +46,7 @@ if CONFIG['OS_TARGET'] == 'Android' and CONFIG['CC_TYPE'] == 'clang':
if CONFIG['MOZ_BUILD_APP'] != 'memory':
FINAL_LIBRARY = 'mozglue'
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += ['-wd4273'] # inconsistent dll linkage (bug 558163)
if CONFIG['MOZ_REPLACE_MALLOC_STATIC']:

Просмотреть файл

@ -14,7 +14,7 @@ EXPORTS.mozilla += [
if CONFIG['WRAP_STL_INCLUDES']:
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
EXPORTS.mozilla += ['throw_gcc.h']
elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
elif CONFIG['CC_TYPE'] == 'clang-cl':
DEFINES['_HAS_EXCEPTIONS'] = 0
SOURCES += [
'msvc_raise_wrappers.cpp',

Просмотреть файл

@ -81,7 +81,7 @@ DEFINES['IMPL_MFBT'] = True
DisableStlWrapping()
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == '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

Просмотреть файл

@ -56,7 +56,7 @@ HOST_SOURCES += [
'tools/brotli.c',
]
if CONFIG['HOST_CC_TYPE'] not in ('msvc', 'clang-cl'):
if CONFIG['HOST_CC_TYPE'] != 'clang-cl':
HOST_OS_LIBS += [
'm' # for log2() function used by Brotli encoder
]

Просмотреть файл

@ -21,7 +21,7 @@ if CONFIG['CC_TYPE'] == 'clang':
'-Wno-dangling-else',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-wd4018', # signed/unsigned mismatch
'-wd4146', # unary minus operator applied to unsigned type

Просмотреть файл

@ -5998,9 +5998,7 @@ pref("dom.datatransfer.mozAtAPIs", true);
#endif
// Whether or not Prio is supported on this platform.
#ifdef MOZ_LIBPRIO
pref("prio.enabled", false);
#endif
// External.AddSearchProvider is deprecated and it will be removed in the next
// cycles.

Просмотреть файл

@ -180,7 +180,7 @@ def library_name_info_template(host_or_target):
if host_or_target.kernel == 'WINNT':
# There aren't artifacts for mingw builds, so it's OK that the
# results are inaccurate in that case.
if compiler and compiler.type not in ('msvc', 'clang-cl'):
if compiler and compiler.type != 'clang-cl':
return namespace(
dll=namespace(prefix='', suffix='.dll'),
lib=namespace(prefix='lib', suffix='a'),

Просмотреть файл

@ -58,8 +58,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT']:
'/memory/build',
]
if CONFIG['CC_TYPE'] == "msvc":
SOURCES += ['WindowsCFGStatus.cpp']
SOURCES += [
'Authenticode.cpp',
'UntrustedDllsHandler.cpp',

Просмотреть файл

@ -247,7 +247,7 @@ def check_nsmodules(target, binary):
# MSVC linker, when doing incremental linking, adds padding when
# merging sections. Allow there to be more space between the NSModule
# symbols, as long as they are in the right order.
test_msvc = (buildconfig.substs.get('CC_TYPE') in ('msvc', 'clang-cl') and \
test_msvc = (buildconfig.substs.get('CC_TYPE') == 'clang-cl' and \
buildconfig.substs.get('DEVELOPER_OPTIONS'))
test_clang = (buildconfig.substs.get('CC_TYPE') == 'clang' and \
buildconfig.substs.get('OS_ARCH') == 'WINNT')

Просмотреть файл

@ -1,127 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import ctypes
import os
import sys
from mozprocess.processhandler import ProcessHandlerMixin
from mozbuild.makeutil import Makefile
CL_INCLUDES_PREFIX = os.environ.get("CL_INCLUDES_PREFIX", "Note: including file:")
GetShortPathName = ctypes.windll.kernel32.GetShortPathNameW
GetLongPathName = ctypes.windll.kernel32.GetLongPathNameW
# cl.exe likes to print inconsistent paths in the showIncludes output
# (some lowercased, some not, with different directions of slashes),
# and we need the original file case for make/pymake to be happy.
# As this is slow and needs to be called a lot of times, use a cache
# to speed things up.
_normcase_cache = {}
def normcase(path):
# Get*PathName want paths with backslashes
path = path.replace('/', os.sep)
dir = os.path.dirname(path)
# name is fortunately always going to have the right case,
# so we can use a cache for the directory part only.
name = os.path.basename(path)
if dir in _normcase_cache:
result = _normcase_cache[dir]
else:
path = ctypes.create_unicode_buffer(dir)
length = GetShortPathName(path, None, 0)
shortpath = ctypes.create_unicode_buffer(length)
GetShortPathName(path, shortpath, length)
length = GetLongPathName(shortpath, None, 0)
if length > len(path):
path = ctypes.create_unicode_buffer(length)
GetLongPathName(shortpath, path, length)
result = _normcase_cache[dir] = path.value
return os.path.join(result, name)
def InvokeClWithDependencyGeneration(cmdline):
target = ""
# Figure out what the target is
for arg in cmdline:
if arg.startswith("-Fo"):
target = arg[3:]
break
if target is None:
print >>sys.stderr, "No target set"
return 1
# Assume the source file is the last argument
source = cmdline[-1]
assert not source.startswith('-')
# The deps target lives here
depstarget = os.path.basename(target) + ".pp"
showincludes = '-showIncludes' in cmdline
cmdline += ['-showIncludes']
mk = Makefile()
rule = mk.create_rule([target])
rule.add_dependencies([normcase(source)])
def on_line(line):
# cl -showIncludes prefixes every header with "Note: including file:"
# and an indentation corresponding to the depth (which we don't need)
if line.startswith(CL_INCLUDES_PREFIX):
dep = line[len(CL_INCLUDES_PREFIX):].strip()
# We can't handle pathes with spaces properly in mddepend.pl, but
# we can assume that anything in a path with spaces is a system
# header and throw it away.
dep = normcase(dep)
if ' ' not in dep:
rule.add_dependencies([dep])
# Hide the line by returning early
if not showincludes:
return
# Make sure we preserve the relevant output from cl. mozprocess
# swallows the newline delimiter, so we need to re-add it.
sys.stdout.write(line)
sys.stdout.write('\n')
# We need to ignore children because MSVC can fire up a background process
# during compilation. This process is cleaned up on its own. If we kill it,
# we can run into weird compilation issues.
p = ProcessHandlerMixin(cmdline, processOutputLine=[on_line],
ignore_children=True)
p.run()
p.processOutput()
ret = p.wait()
if ret != 0 or target == "":
# p.wait() returns a long. Somehow sys.exit(long(0)) is like
# sys.exit(1). Don't ask why.
return int(ret)
depsdir = os.path.normpath(os.path.join(os.curdir, ".deps"))
depstarget = os.path.join(depsdir, depstarget)
if not os.path.isdir(depsdir):
try:
os.makedirs(depsdir)
except OSError:
pass # This suppresses the error we get when the dir exists, at the
# cost of masking failure to create the directory. We'll just
# die on the next line though, so it's not that much of a loss.
with open(depstarget, "w") as f:
mk.dump(f)
return 0
def main(args):
return InvokeClWithDependencyGeneration(args)
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))

Просмотреть файл

@ -484,12 +484,6 @@ class CompileFlags(BaseCompileFlags):
def _warnings_as_errors(self):
warnings_as_errors = self._context.config.substs.get('WARNINGS_AS_ERRORS')
if self._context.config.substs.get('MOZ_PGO'):
# Don't use warnings-as-errors in MSVC PGO builds because it is suspected of
# causing problems in that situation. (See bug 437002.)
if self._context.config.substs.get('CC_TYPE') == 'msvc':
warnings_as_errors = None
if warnings_as_errors:
return [warnings_as_errors]

Просмотреть файл

@ -243,7 +243,7 @@ def process_gyp_result(gyp_result, gyp_dir_attrs, path, config, output,
context['UNIFIED_SOURCES'] = alphabetical_sorted(unified_sources)
defines = target_conf.get('defines', [])
if config.substs['CC_TYPE'] in ('msvc', 'clang-cl') and no_chromium:
if config.substs['CC_TYPE'] == 'clang-cl' and no_chromium:
msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, {})
defines.extend(msvs_settings.GetComputedDefines(c))
for define in defines:
@ -380,7 +380,7 @@ class GypProcessor(object):
# gyp expects plain str instead of unicode. The frontend code gives us
# unicode strings, so convert them.
path = encode(path)
if config.substs['CC_TYPE'] in ('msvc', 'clang-cl'):
if config.substs['CC_TYPE'] == 'clang-cl':
# This isn't actually used anywhere in this generator, but it's needed
# to override the registry detection of VC++ in gyp.
os.environ['GYP_MSVS_OVERRIDE_PATH'] = 'fake_path'

Просмотреть файл

@ -70,8 +70,6 @@ def GCC_BASE(version):
'__GNUC_MINOR__': version.minor,
'__GNUC_PATCHLEVEL__': version.patch,
'__STDC__': 1,
'__ORDER_LITTLE_ENDIAN__': 1234,
'__ORDER_BIG_ENDIAN__': 4321,
})
@ -102,10 +100,14 @@ DEFAULT_GCC = GCC_6
DEFAULT_GXX = GXX_6
GCC_PLATFORM_LITTLE_ENDIAN = {
'__ORDER_LITTLE_ENDIAN__': 1234,
'__ORDER_BIG_ENDIAN__': 4321,
'__BYTE_ORDER__': 1234,
}
GCC_PLATFORM_BIG_ENDIAN = {
'__ORDER_LITTLE_ENDIAN__': 1234,
'__ORDER_BIG_ENDIAN__': 4321,
'__BYTE_ORDER__': 4321,
}
@ -234,14 +236,6 @@ def VS(version):
})
VS_2013u2 = VS('18.00.30501')
VS_2013u3 = VS('18.00.30723')
VS_2015 = VS('19.00.23026')
VS_2015u1 = VS('19.00.23506')
VS_2015u2 = VS('19.00.23918')
VS_2015u3 = VS('19.00.24213')
VS_2017u4 = VS('19.11.25547')
VS_2017u6 = VS('19.13.26128')
VS_2017u8 = VS('19.15.26726')
VS_PLATFORM_X86 = {
@ -265,8 +259,10 @@ CLANG_CL_3_9 = (CLANG_BASE('3.9.0') + VS('18.00.00000') + DEFAULT_C11 +
},
}
CLANG_CL_PLATFORM_X86 = FakeCompiler(VS_PLATFORM_X86, GCC_PLATFORM_X86[None])
CLANG_CL_PLATFORM_X86_64 = FakeCompiler(VS_PLATFORM_X86_64, GCC_PLATFORM_X86_64[None])
CLANG_CL_PLATFORM_X86 = FakeCompiler(
VS_PLATFORM_X86, GCC_PLATFORM_X86[None], GCC_PLATFORM_LITTLE_ENDIAN)
CLANG_CL_PLATFORM_X86_64 = FakeCompiler(
VS_PLATFORM_X86_64, GCC_PLATFORM_X86_64[None], GCC_PLATFORM_LITTLE_ENDIAN)
LIBRARY_NAME_INFOS = {
'linux-gnu': {
@ -385,7 +381,7 @@ class BaseToolchainTest(BaseConfigureTest):
target_os = getattr(self, 'TARGET', self.HOST).split('-', 2)[2]
if target_os == 'mingw32':
compiler_type = sandbox._value_for(sandbox['c_compiler']).type
if compiler_type in ('msvc', 'clang-cl'):
if compiler_type == 'clang-cl':
target_os = 'msvc'
elif target_os == 'linux-gnuabi64':
target_os = 'linux-gnu'
@ -874,14 +870,6 @@ class WindowsToolchainTest(BaseToolchainTest):
# For the purpose of this test, it doesn't matter that the paths are not
# real Windows paths.
PATHS = {
'/opt/VS_2013u2/bin/cl': VS_2013u2 + VS_PLATFORM_X86,
'/opt/VS_2013u3/bin/cl': VS_2013u3 + VS_PLATFORM_X86,
'/opt/VS_2015/bin/cl': VS_2015 + VS_PLATFORM_X86,
'/opt/VS_2015u1/bin/cl': VS_2015u1 + VS_PLATFORM_X86,
'/opt/VS_2015u2/bin/cl': VS_2015u2 + VS_PLATFORM_X86,
'/opt/VS_2015u3/bin/cl': VS_2015u3 + VS_PLATFORM_X86,
'/opt/VS_2017u4/bin/cl': VS_2017u4 + VS_PLATFORM_X86,
'/opt/VS_2017u6/bin/cl': VS_2017u6 + VS_PLATFORM_X86,
'/usr/bin/cl': VS_2017u8 + VS_PLATFORM_X86,
'/usr/bin/clang-cl': CLANG_CL_3_9 + CLANG_CL_PLATFORM_X86,
'/usr/bin/gcc': DEFAULT_GCC + GCC_PLATFORM_X86_WIN,
@ -900,32 +888,6 @@ class WindowsToolchainTest(BaseToolchainTest):
'/usr/bin/clang++-3.3': CLANGXX_3_3 + CLANG_PLATFORM_X86_WIN,
}
VS_FAILURE_MESSAGE = (
'This version (%s) of the MSVC compiler is not supported.\nYou must'
' install Visual C++ 2017 Update 8 or later in order to build.\n'
'See https://developer.mozilla.org/en/Windows_Build_Prerequisites')
VS_2013u2_RESULT = VS_FAILURE_MESSAGE % '18.00.30501'
VS_2013u3_RESULT = VS_FAILURE_MESSAGE % '18.00.30723'
VS_2015_RESULT = VS_FAILURE_MESSAGE % '19.00.23026'
VS_2015u1_RESULT = VS_FAILURE_MESSAGE % '19.00.23506'
VS_2015u2_RESULT = VS_FAILURE_MESSAGE % '19.00.23918'
VS_2015u3_RESULT = VS_FAILURE_MESSAGE % '19.00.24213'
VS_2017u4_RESULT = VS_FAILURE_MESSAGE % '19.11.25547'
VS_2017u6_RESULT = VS_FAILURE_MESSAGE % '19.13.26128'
VS_2017u8_RESULT = CompilerResult(
flags=[],
version='19.15.26726',
type='msvc',
compiler='/usr/bin/cl',
language='C',
)
VSXX_2017u8_RESULT = CompilerResult(
flags=[],
version='19.15.26726',
type='msvc',
compiler='/usr/bin/cl',
language='C++',
)
CLANG_CL_3_9_RESULT = CompilerResult(
version='3.9.0',
flags=['-Xclang', '-std=gnu99'],
@ -953,65 +915,11 @@ class WindowsToolchainTest(BaseToolchainTest):
DEFAULT_GCC_RESULT = LinuxToolchainTest.DEFAULT_GCC_RESULT
DEFAULT_GXX_RESULT = LinuxToolchainTest.DEFAULT_GXX_RESULT
# VS2017u6 or greater is required.
def test_msvc(self):
# We'll pick msvc if clang-cl can't be found.
paths = {
k: v for k, v in self.PATHS.iteritems()
if os.path.basename(k) != 'clang-cl'
}
self.do_toolchain_test(paths, {
'c_compiler': self.VS_2017u8_RESULT,
'cxx_compiler': self.VSXX_2017u8_RESULT,
})
def test_unsupported_msvc(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.VS_2017u6_RESULT,
'c_compiler': 'Unknown compiler or compiler not supported.'
}, environ={
'CC': '/opt/VS_2017u6/bin/cl',
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.VS_2017u4_RESULT,
}, environ={
'CC': '/opt/VS_2017u4/bin/cl',
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.VS_2015u3_RESULT,
}, environ={
'CC': '/opt/VS_2015u3/bin/cl',
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.VS_2015u2_RESULT,
}, environ={
'CC': '/opt/VS_2015u2/bin/cl',
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.VS_2015u1_RESULT,
}, environ={
'CC': '/opt/VS_2015u1/bin/cl',
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.VS_2015_RESULT,
}, environ={
'CC': '/opt/VS_2015/bin/cl',
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.VS_2013u3_RESULT,
}, environ={
'CC': '/opt/VS_2013u3/bin/cl',
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.VS_2013u2_RESULT,
}, environ={
'CC': '/opt/VS_2013u2/bin/cl',
'CC': '/usr/bin/cl',
})
def test_clang_cl(self):
@ -1060,15 +968,6 @@ class WindowsToolchainTest(BaseToolchainTest):
'CXX': 'clang++-3.3',
})
def test_cannot_cross(self):
paths = {
'/usr/bin/cl': VS_2017u8 + VS_PLATFORM_X86_64,
}
self.do_toolchain_test(paths, {
'c_compiler': ('Target C compiler target CPU (x86_64) '
'does not match --target CPU (i686)'),
})
class Windows64ToolchainTest(WindowsToolchainTest):
HOST = 'x86_64-pc-mingw32'
@ -1076,14 +975,6 @@ class Windows64ToolchainTest(WindowsToolchainTest):
# For the purpose of this test, it doesn't matter that the paths are not
# real Windows paths.
PATHS = {
'/opt/VS_2013u2/bin/cl': VS_2013u2 + VS_PLATFORM_X86_64,
'/opt/VS_2013u3/bin/cl': VS_2013u3 + VS_PLATFORM_X86_64,
'/opt/VS_2015/bin/cl': VS_2015 + VS_PLATFORM_X86_64,
'/opt/VS_2015u1/bin/cl': VS_2015u1 + VS_PLATFORM_X86_64,
'/opt/VS_2015u2/bin/cl': VS_2015u2 + VS_PLATFORM_X86_64,
'/opt/VS_2015u3/bin/cl': VS_2015u3 + VS_PLATFORM_X86_64,
'/opt/VS_2017u4/bin/cl': VS_2017u4 + VS_PLATFORM_X86_64,
'/opt/VS_2017u6/bin/cl': VS_2017u6 + VS_PLATFORM_X86_64,
'/usr/bin/cl': VS_2017u8 + VS_PLATFORM_X86_64,
'/usr/bin/clang-cl': CLANG_CL_3_9 + CLANG_CL_PLATFORM_X86_64,
'/usr/bin/gcc': DEFAULT_GCC + GCC_PLATFORM_X86_64_WIN,
@ -1104,15 +995,6 @@ class Windows64ToolchainTest(WindowsToolchainTest):
'/usr/bin/clang++-3.3': CLANGXX_3_3 + CLANG_PLATFORM_X86_64_WIN,
}
def test_cannot_cross(self):
paths = {
'/usr/bin/cl': VS_2017u8 + VS_PLATFORM_X86,
}
self.do_toolchain_test(paths, {
'c_compiler': ('Target C compiler target CPU (x86) '
'does not match --target CPU (x86_64)'),
})
class LinuxCrossCompileToolchainTest(BaseToolchainTest):
TARGET = 'arm-unknown-linux-gnu'
@ -1454,18 +1336,6 @@ class WindowsCrossToolchainTest(BaseToolchainTest):
DEFAULT_CLANG_RESULT = LinuxToolchainTest.DEFAULT_CLANG_RESULT
DEFAULT_CLANGXX_RESULT = LinuxToolchainTest.DEFAULT_CLANGXX_RESULT
def test_wsl_cross(self):
paths = {
'/usr/bin/cl': VS_2017u8 + VS_PLATFORM_X86_64,
}
paths.update(LinuxToolchainTest.PATHS)
self.do_toolchain_test(paths, {
'c_compiler': WindowsToolchainTest.VS_2017u8_RESULT,
'cxx_compiler': WindowsToolchainTest.VSXX_2017u8_RESULT,
'host_c_compiler': self.DEFAULT_CLANG_RESULT,
'host_cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
})
def test_clang_cl_cross(self):
paths = {
'/usr/bin/clang-cl': CLANG_CL_3_9 + CLANG_CL_PLATFORM_X86_64,

Просмотреть файл

@ -868,15 +868,14 @@ class TestMisc(unittest.TestCase):
class TestEnumString(unittest.TestCase):
def test_string(self):
CompilerType = EnumString.subclass('msvc', 'gcc', 'clang', 'clang-cl')
CompilerType = EnumString.subclass('gcc', 'clang', 'clang-cl')
type = CompilerType('msvc')
self.assertEquals(type, 'msvc')
self.assertNotEquals(type, 'gcc')
type = CompilerType('gcc')
self.assertEquals(type, 'gcc')
self.assertNotEquals(type, 'clang')
self.assertNotEquals(type, 'clang-cl')
self.assertIn(type, ('msvc', 'clang-cl'))
self.assertNotIn(type, ('gcc', 'clang'))
self.assertIn(type, ('gcc', 'clang-cl'))
self.assertNotIn(type, ('clang', 'clang-cl'))
with self.assertRaises(EnumStringComparisonError):
self.assertEquals(type, 'foo')

Просмотреть файл

@ -45,79 +45,6 @@ if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += ['-Xclang']
CXXFLAGS += ['-Wall']
if CONFIG['CC_TYPE'] == 'msvc':
# -Wall with Visual C++ enables too many problematic warnings
CXXFLAGS += [
'-wd4324', # structure was padded due to __declspec(align())
'-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
'-wd4512', # assignment operator could not be generated
'-wd4514', # 'function': unreferenced inline function has been removed
'-wd4610', # struct 'symbol' can never be instantiated - user defined
# constructor required
'-wd4619', # pragma warning: there is no warning 'warning'
'-wd4623', # default constructor could not be generated because a base
# class default constructor is inaccessible or deleted
'-wd4625', # copy constructor could not be generated because a base
# class copy constructor is inaccessible or deleted
'-wd4626', # assignment operator could not be generated because a base
# class assignment operator is inaccessible or deleted
'-wd4628', # digraphs not supported with -Ze (nsThreadUtils.h includes
# what would be the digraph "<:" in the expression
# "mozilla::EnableIf<::detail::...". Since we don't want it
# interpreted as a digraph anyway, we can disable the
# warning.)
'-wd4640', # construction of local static object is not thread-safe
'-wd4710', # 'function': function not inlined
'-wd4711', # function 'function' selected for inline expansion
'-wd4820', # 'bytes' bytes padding added after construct 'member_name'
]
# Disable Spectre diagnostics only if optimization is disabled.
# AArch64 MSVC apparently warns about Spectre even if optimization is
# enabled, so disable the diagnostic there too.
if not CONFIG['MOZ_OPTIMIZE'] or CONFIG['CPU_ARCH'] == 'aarch64':
CXXFLAGS += [
'-wd5045', # Compiler will insert Spectre mitigation for memory
# load if /Qspectre switch specified
]
# MSVC 2010's headers trigger these
CXXFLAGS += [
'-wd4548', # expression before comma has no effect; ...
'-wd4668', # 'symbol' is not defined as a preprocessor macro...
'-wd4987', # nonstandard extension used
]
# MSVC 2015 triggers these
CXXFLAGS += [
'-wd4456', # declaration of 'rv' hides previous local declaration
'-wd4458', # declaration of 'input' hides class member
]
# The following warnings are disabled because MSVC 2017 headers aren't
# warning free at the -Wall level.
CXXFLAGS += [
'-wd4061', # enumerator 'identifier' in switch of enum 'enumeration' is
# not explicitly handled by a case label
'-wd4365', # 'action' : conversion from 'type_1' to 'type_2',
# signed/unsigned mismatch
'-wd4774', # '<function>' : format string expected in argument
# <position> is not a string literal
]
# Gecko headers aren't warning-free enough for us to enable these warnings
CXXFLAGS += [
'-wd4100', # 'symbol' : unreferenced formal parameter
'-wd4127', # conditional expression is constant
'-wd4946', # reinterpret_cast used between related types
]
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CXXFLAGS += [
'-Wextra',
'-Wunreachable-code',

Просмотреть файл

@ -43,72 +43,6 @@ if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += ['-Xclang']
CXXFLAGS += ['-Wall']
if CONFIG['CC_TYPE'] == 'msvc':
# -Wall with Visual C++ enables too many problematic warnings
CXXFLAGS += [
'-wd4324', # structure was padded due to __declspec(align())
'-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
'-wd4512', # assignment operator could not be generated
'-wd4514', # 'function': unreferenced inline function has been removed
'-wd4610', # struct 'symbol' can never be instantiated - user defined
# constructor required
'-wd4619', # pragma warning: there is no warning 'warning'
'-wd4623', # default constructor could not be generated because a base
# class default constructor is inaccessible or deleted
'-wd4625', # copy constructor could not be generated because a base
# class copy constructor is inaccessible or deleted
'-wd4626', # assignment operator could not be generated because a base
# class assignment operator is inaccessible or deleted
'-wd4640', # construction of local static object is not thread-safe
'-wd4710', # 'function': function not inlined
'-wd4711', # function 'function' selected for inline expansion
'-wd4820', # 'bytes' bytes padding added after construct 'member_name'
]
# Disable Spectre diagnostics only if optimization is disabled.
if not CONFIG['MOZ_OPTIMIZE']:
CXXFLAGS += [
'-wd5045', # Compiler will insert Spectre mitigation for memory
# load if /Qspectre switch specified
]
# MSVC 2010's headers trigger these
CXXFLAGS += [
'-wd4548', # expression before comma has no effect; ...
'-wd4668', # 'symbol' is not defined as a preprocessor macro...
'-wd4987', # nonstandard extension used
]
# MSVC 2015 triggers these
CXXFLAGS += [
'-wd4456', # declaration of 'rv' hides previous local declaration
'-wd4458', # declaration of 'input' hides class member
]
# The following warnings are disabled because MSVC 2017 headers aren't
# warning free at the -Wall level.
CXXFLAGS += [
'-wd4061', # enumerator 'identifier' in switch of enum 'enumeration' is
# not explicitly handled by a case label
'-wd4365', # 'action' : conversion from 'type_1' to 'type_2',
# signed/unsigned mismatch
'-wd4774', # '<function>' : format string expected in argument
# <position> is not a string literal
]
# Gecko headers aren't warning-free enough for us to enable these warnings
CXXFLAGS += [
'-wd4100', # 'symbol' : unreferenced formal parameter
'-wd4127', # conditional expression is constant
'-wd4946', # reinterpret_cast used between related types
]
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CXXFLAGS += [
'-Wextra',
'-Wunreachable-code',

Просмотреть файл

@ -169,7 +169,7 @@ elif CONFIG['OS_ARCH'] == 'WINNT':
DisableStlWrapping()
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == '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

Просмотреть файл

@ -21,7 +21,7 @@ if CONFIG['CC_TYPE'] == 'clang-cl':
'-Xclang',
'-fcxx-exceptions',
]
elif CONFIG['CC_TYPE'] not in ('msvc', 'clang-cl'):
elif CONFIG['CC_TYPE'] != 'clang-cl':
CXXFLAGS += [
'-fexceptions',
]
@ -32,7 +32,7 @@ DisableStlWrapping()
Library('jsoncpp')
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-wd4005', # macro redefinition
]
@ -47,7 +47,6 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
'-Wno-c++11-narrowing',
]
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
CXXFLAGS += [
'-Wno-implicit-fallthrough',
]

Просмотреть файл

@ -34,7 +34,7 @@ LOCAL_INCLUDES += [
USE_STATIC_LIBS = True
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
RCINCLUDE = 'maintenanceservice.rc'

Просмотреть файл

@ -136,7 +136,7 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
'-Wno-null-conversion',
'-Wno-unused-local-typedef',
]
elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
elif CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-wd4005', # 'WIN32_LEAN_AND_MEAN' : macro redefinition
'-wd4018', # '<' : signed/unsigned mismatch

Просмотреть файл

@ -10,7 +10,7 @@ LOCAL_INCLUDES += [
]
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-wd4005', # macro redefinition
'-wd4146', # negative unsigned
@ -34,7 +34,7 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
'-Wno-c++11-narrowing',
]
if CONFIG['CC_TYPE'] not in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] != 'clang-cl':
CXXFLAGS += [
'-Wno-implicit-fallthrough',
]

Просмотреть файл

@ -19,7 +19,7 @@ HOST_CXXFLAGS += [
'-O2',
]
if CONFIG['HOST_CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['HOST_CC_TYPE'] == 'clang-cl':
HOST_CXXFLAGS += [
'-EHsc',
'-MD'

Просмотреть файл

@ -36,7 +36,7 @@ if CONFIG['CC_TYPE'] == 'clang-cl':
'-Xclang',
'-fcxx-exceptions',
]
elif CONFIG['CC_TYPE'] not in ('msvc', 'clang-cl'):
else:
SOURCES['ExceptionThrower.cpp'].flags += [
'-fexceptions',
]
@ -57,5 +57,5 @@ include('/toolkit/crashreporter/crashreporter.mozbuild')
NO_PGO = True
# Temporary workaround for an issue in upstream breakpad
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += ['-wd4334']

Просмотреть файл

@ -85,7 +85,7 @@ def Libxul(name, output_category=None):
LDFLAGS += ['-Wl,-U,_OBJC_CLASS_$_NSCustomTouchBarItem']
LDFLAGS += ['-lresolv']
if CONFIG['MOZ_DEBUG_SYMBOLS'] and CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['MOZ_DEBUG_SYMBOLS'] and CONFIG['CC_TYPE'] == 'clang-cl':
LDFLAGS += ['-NATVIS:%s/toolkit/library/gecko.natvis' % TOPSRCDIR]
if CONFIG['RUSTC_NATVIS_LDFLAGS']:
LDFLAGS += CONFIG['RUSTC_NATVIS_LDFLAGS']
@ -323,7 +323,7 @@ if CONFIG['OS_ARCH'] == 'WINNT':
'dhcpcsvc',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
OS_LIBS += [
'runtimeobject',
]

Просмотреть файл

@ -425,16 +425,9 @@ imply_option('--enable-fmp4', ffmpeg, '--enable-ffmpeg')
option('--disable-av1',
help='Disable av1 video support')
@depends('--enable-av1', target, c_compiler)
def av1(value, target, c_compiler):
enabled = bool(value)
if value.origin == 'default':
if target.os == 'WINNT' and target.cpu == 'x86' and \
c_compiler and c_compiler.type == 'msvc':
enabled = False
else:
enabled = True
if enabled:
@depends('--enable-av1')
def av1(value):
if value:
return True
@depends(target, nasm_version, when=av1 & compile_environment)
@ -1141,17 +1134,14 @@ midl = check_prog('MIDL', midl_names, when=check_for_midl, allow_missing=True,
when=depends(midl, target)(lambda m, t: m and t.kernel == 'WINNT'))
@imports(_from='mozbuild.shellutil', _import='quote')
def midl_flags(c_compiler, target, toolchain_search_path):
if c_compiler and c_compiler.type in ('msvc', 'clang-cl'):
if c_compiler and c_compiler.type == 'clang-cl':
env = {
'x86': 'win32',
'x86_64': 'x64',
'aarch64': 'arm64',
}[target.cpu]
flags = ['-env', env]
if c_compiler.type == 'msvc':
flags += ['-cpp_cmd', c_compiler.compiler]
else:
# Ideally, we'd use the same flags setup as for msvc, but clang-cl
# Ideally, we'd use ['-cpp_cmd', c_compiler.compiler], but clang-cl
# currently doesn't work as a preprocessor for midl, so we need to
# find cl. https://bugs.llvm.org/show_bug.cgi?id=40140
cl = find_program('cl', paths=toolchain_search_path)
@ -1243,18 +1233,6 @@ def launcher(value, target):
set_config('MOZ_LAUNCHER_PROCESS', launcher)
set_define('MOZ_LAUNCHER_PROCESS', launcher)
# Prio
# ==============================================================
@depends(c_compiler)
def libprio(info):
if info:
# MSVC is not supported by libprio.
if info.type in ('msvc',):
return None
return True
set_config('MOZ_LIBPRIO', libprio)
# Maintenance service (Windows only)
# ==============================================================

Просмотреть файл

@ -101,7 +101,7 @@ DELAYLOAD_DLLS += [
'wsock32.dll',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
elif CONFIG['OS_ARCH'] == 'WINNT':
WIN32_EXE_LDFLAGS += ['-municode']

Просмотреть файл

@ -151,7 +151,7 @@ OS_LIBS += [
'rpcrt4',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
SOURCES += [
'ToastNotification.cpp',
'ToastNotificationHandler.cpp',

Просмотреть файл

@ -133,12 +133,6 @@ UNIFIED_SOURCES += [
SOURCES += [
'nsGkAtoms.cpp',
]
if CONFIG['CC_TYPE'] == 'msvc':
# Needed for gGkAtoms.
SOURCES['nsGkAtoms.cpp'].flags += [
'-constexpr:steps300000',
'-Zc:externConstexpr',
]
LOCAL_INCLUDES += [
'../io',

Просмотреть файл

@ -13,7 +13,7 @@ Library('xpcomglue')
FORCE_STATIC_LIB = True
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == 'clang-cl':
DEFINES['_USE_ANSI_CPP'] = True
# Don't include directives about which CRT to use
CFLAGS += ['-Zl']

Просмотреть файл

@ -135,9 +135,6 @@ UNIFIED_SOURCES += [
SOURCES += [
'nsDirectoryService.cpp',
]
if CONFIG['CC_TYPE'] == 'msvc':
# Needed for gDirectoryAtoms.
SOURCES['nsDirectoryService.cpp'].flags += ['-Zc:externConstexpr']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
SOURCES += [
@ -156,7 +153,7 @@ LOCAL_INCLUDES += [
'../build',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
if CONFIG['CC_TYPE'] == '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'