Dactyloidae/modules/fdlibm/src/moz.build
Job Bautista b592711bb2 Issue #2221 - Enable link-time optimization for Spidermonkey by default if building it shared.
Currently only Windows can take advantage of this.

The reason why the arrays of deunified sources are named like that in
Spidermonkey's moz.build is to avoid UnsortedErrors in python. There's probably
a better way to handle that, but I just want something that works for now.

And yes, the deunified sources will be reunified if LTO is disabled.
2023-05-01 06:52:48 +08:00

80 lines
1.8 KiB
INI

# -*- 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/.
EXPORTS += [
'fdlibm.h',
]
FINAL_LIBRARY = 'js'
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += [
'-Wno-parentheses',
'-Wno-sign-compare',
]
if CONFIG['CC_TYPE'] == 'clang':
CXXFLAGS += [
'-Wno-dangling-else',
]
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
CXXFLAGS += [
'-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
]
if CONFIG['CC_TYPE'] == 'msvc':
CXXFLAGS += [
'-wd4018', # signed/unsigned mismatch
]
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-Wno-sign-compare', # signed/unsigned mismatch
]
# Explicitly enable WPO and LTCG in MSVC if we're doing LTO.
if CONFIG['JS_LTO']:
if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
CFLAGS += [ '-GL' ]
CXXFLAGS += [ '-GL' ]
SOURCES += [
'e_acos.cpp',
'e_acosh.cpp',
'e_asin.cpp',
'e_atan2.cpp',
'e_atanh.cpp',
'e_cosh.cpp',
'e_exp.cpp',
'e_hypot.cpp',
'e_log.cpp',
'e_log10.cpp',
'e_log2.cpp',
'e_pow.cpp',
'e_sinh.cpp',
'k_exp.cpp',
's_asinh.cpp',
's_atan.cpp',
's_cbrt.cpp',
's_ceil.cpp',
's_ceilf.cpp',
's_copysign.cpp',
's_expm1.cpp',
's_fabs.cpp',
's_floor.cpp',
's_floorf.cpp',
's_log1p.cpp',
's_nearbyint.cpp',
's_rint.cpp',
's_rintf.cpp',
's_scalbn.cpp',
's_tanh.cpp',
's_trunc.cpp',
's_truncf.cpp',
]