mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 16:58:38 +09:00
Issue #1676 - Part 2: Split CFLAGS and CXXFLAGS directives out of js/src/moz.build
This commit is contained in:
parent
b69cf124dc
commit
209c7f2305
2 changed files with 45 additions and 34 deletions
42
js/src/js-cxxflags.mozbuild
Normal file
42
js/src/js-cxxflags.mozbuild
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# 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/.
|
||||
|
||||
CFLAGS += CONFIG['MOZ_ICU_CFLAGS']
|
||||
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
|
||||
|
||||
if CONFIG['_MSC_VER']:
|
||||
# Prevent floating point errors caused by VC++ optimizations
|
||||
CFLAGS += ['-fp:precise']
|
||||
CXXFLAGS += ['-fp:precise']
|
||||
|
||||
# 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.
|
||||
CXXFLAGS += ['-wd4805']
|
||||
|
||||
# C4661 ("no suitable definition provided for explicit template
|
||||
# instantiation request") is emitted for all Parser methods that
|
||||
# have a Parser<FullParseHandler> definition but no
|
||||
# Parser<SyntaxParseHandler> definition, see bug 1167030.
|
||||
CXXFLAGS += ['-wd4661', '-we4067', '-we4258', '-we4275']
|
||||
CXXFLAGS += ['-wd4146'] # FIXME: unary minus operator applied to unsigned type (bug 1229189)
|
||||
|
||||
# This is intended as a temporary hack to support building with VS2015.
|
||||
# 'noexcept' used with no exception handling mode specified;
|
||||
# termination on exception is not guaranteed. Specify /EHsc
|
||||
CXXFLAGS += ['-wd4577', '-wd4312']
|
||||
|
||||
if CONFIG['GNU_CXX']:
|
||||
# Disable strict-aliasing for GCC, which is enabled by default
|
||||
# starting with version 7.1, see Mozilla bug 1363009.
|
||||
CXXFLAGS += ['-Wno-shadow', '-Werror=format', '-fno-strict-aliasing']
|
||||
|
||||
if CONFIG['JS_HAS_CTYPES'] and CONFIG['MOZ_SYSTEM_FFI']:
|
||||
CXXFLAGS += CONFIG['MOZ_FFI_CFLAGS']
|
||||
|
||||
if CONFIG['JS_CODEGEN_ARM'] and CONFIG['JS_SIMULATOR_ARM']:
|
||||
# Configuration used only for testing.
|
||||
if CONFIG['OS_ARCH'] == 'Linux' or CONFIG['OS_ARCH'] == 'Darwin':
|
||||
CXXFLAGS += [ '-msse2', '-mfpmath=sse' ]
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
# 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/.
|
||||
|
||||
include('js-cxxflags.mozbuild')
|
||||
include('js-testing.mozbuild')
|
||||
|
||||
FILES_PER_UNIFIED_FILE = 6
|
||||
|
|
@ -446,9 +447,6 @@ elif CONFIG['JS_CODEGEN_ARM']:
|
|||
UNIFIED_SOURCES += [
|
||||
'jit/arm/Simulator-arm.cpp'
|
||||
]
|
||||
# Configuration used only for testing.
|
||||
if CONFIG['OS_ARCH'] == 'Linux' or CONFIG['OS_ARCH'] == 'Darwin':
|
||||
CXXFLAGS += [ '-msse2', '-mfpmath=sse' ]
|
||||
elif CONFIG['OS_ARCH'] == 'Darwin':
|
||||
SOURCES += [
|
||||
'jit/arm/llvm-compiler-rt/arm/aeabi_idivmod.S',
|
||||
|
|
@ -641,26 +639,6 @@ if CONFIG['_MSC_VER']:
|
|||
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
|
||||
CFLAGS += ['-fp:precise']
|
||||
CXXFLAGS += ['-fp:precise']
|
||||
# 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.
|
||||
CXXFLAGS += ['-wd4805']
|
||||
# C4661 ("no suitable definition provided for explicit template
|
||||
# instantiation request") is emitted for all Parser methods that
|
||||
# have a Parser<FullParseHandler> definition but no
|
||||
# Parser<SyntaxParseHandler> definition, see bug 1167030.
|
||||
CXXFLAGS += ['-wd4661']
|
||||
CXXFLAGS += ['-we4067', '-we4258', '-we4275']
|
||||
CXXFLAGS += ['-wd4146'] # FIXME: unary minus operator applied to unsigned type (bug 1229189)
|
||||
|
||||
# This is intended as a temporary hack to support building with VS2015.
|
||||
# 'noexcept' used with no exception handling mode specified;
|
||||
# termination on exception is not guaranteed. Specify /EHsc
|
||||
CXXFLAGS += ['-wd4577']
|
||||
CXXFLAGS += ['-wd4312']
|
||||
|
||||
if CONFIG['OS_ARCH'] not in ('WINNT'):
|
||||
OS_LIBS += [
|
||||
|
|
@ -687,9 +665,6 @@ if CONFIG['OS_ARCH'] == 'SunOS':
|
|||
|
||||
OS_LIBS += CONFIG['REALTIME_LIBS']
|
||||
|
||||
CFLAGS += CONFIG['MOZ_ICU_CFLAGS']
|
||||
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
|
||||
|
||||
NO_EXPAND_LIBS = True
|
||||
|
||||
DIST_INSTALL = True
|
||||
|
|
@ -732,18 +707,12 @@ selfhosted.inputs = [
|
|||
]
|
||||
|
||||
if CONFIG['JS_HAS_CTYPES']:
|
||||
if CONFIG['MOZ_SYSTEM_FFI']:
|
||||
CXXFLAGS += CONFIG['MOZ_FFI_CFLAGS']
|
||||
else:
|
||||
if not CONFIG['MOZ_SYSTEM_FFI']:
|
||||
# Windows needs this to be linked with a static library.
|
||||
DEFINES['FFI_BUILDING'] = True
|
||||
|
||||
if CONFIG['GNU_CXX']:
|
||||
# Disable strict-aliasing for GCC, which is enabled by default
|
||||
# starting with version 7.1, see Mozilla bug 1363009.
|
||||
CXXFLAGS += ['-Wno-shadow', '-Werror=format', '-fno-strict-aliasing']
|
||||
|
||||
# Suppress warnings in third-party code.
|
||||
# We are keeping this in the main moz.build because it is file specific
|
||||
if CONFIG['CLANG_CXX'] or CONFIG['GNU_CXX']:
|
||||
SOURCES['jsdtoa.cpp'].flags += ['-Wno-implicit-fallthrough']
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue