mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-10 13:54:27 +00:00
Bug 973649 - Add logic for CFLAGS, CXXFLAGS and LDFLAGS to moz.build; r=mshal
This commit is contained in:
parent
6735b2344d
commit
97afa6dc6b
@ -242,6 +242,9 @@ class TreeMetadataEmitter(LoggingMixin):
|
||||
'RESFILE',
|
||||
'DEFFILE',
|
||||
'SDK_LIBRARY',
|
||||
'CFLAGS',
|
||||
'CXXFLAGS',
|
||||
'LDFLAGS',
|
||||
]
|
||||
for v in varlist:
|
||||
if v in sandbox and sandbox[v]:
|
||||
|
@ -683,6 +683,33 @@ VARIABLES = {
|
||||
'SPHINX_PYTHON_PACKAGE_DIRS': (StrictOrderingOnAppendList, list,
|
||||
"""Directories containing Python packages that Sphinx documents.
|
||||
""", None),
|
||||
|
||||
'CFLAGS': (list, list,
|
||||
"""Flags passed to the C compiler for all of the C source files
|
||||
declared in this directory.
|
||||
|
||||
Note that the ordering of flags matter here, these flags will be
|
||||
added to the compiler's command line in the same order as they
|
||||
appear in the moz.build file.
|
||||
""", 'binaries'),
|
||||
|
||||
'CXXFLAGS': (list, list,
|
||||
"""Flags passed to the C++ compiler for all of the C++ source files
|
||||
declared in this directory.
|
||||
|
||||
Note that the ordering of flags matter here, these flags will be
|
||||
added to the compiler's command line in the same order as they
|
||||
appear in the moz.build file.
|
||||
""", 'binaries'),
|
||||
|
||||
'LDFLAGS': (list, list,
|
||||
"""Flags passed to the linker when linking all of the libraries and
|
||||
executables declared in this directory.
|
||||
|
||||
Note that the ordering of flags matter here, these flags will be
|
||||
added to the linker's command line in the same order as they
|
||||
appear in the moz.build file.
|
||||
""", 'libs'),
|
||||
}
|
||||
|
||||
# The set of functions exposed to the sandbox.
|
||||
|
@ -41,3 +41,7 @@ RESFILE = 'bar.res'
|
||||
DEFFILE = 'baz.def'
|
||||
|
||||
USE_STATIC_LIBS = True
|
||||
|
||||
CFLAGS += ['-fno-exceptions', '-w']
|
||||
CXXFLAGS += ['-fcxx-exceptions', '-include foo.h']
|
||||
LDFLAGS += ['-framework Foo', '-x']
|
||||
|
@ -340,6 +340,18 @@ class TestRecursiveMakeBackend(BackendTester):
|
||||
'USE_STATIC_LIBS': [
|
||||
'USE_STATIC_LIBS := 1',
|
||||
],
|
||||
'CFLAGS': [
|
||||
'CFLAGS += -fno-exceptions',
|
||||
'CFLAGS += -w',
|
||||
],
|
||||
'CXXFLAGS': [
|
||||
'CXXFLAGS += -fcxx-exceptions',
|
||||
'CXXFLAGS += -include foo.h',
|
||||
],
|
||||
'LDFLAGS': [
|
||||
'LDFLAGS += -framework Foo',
|
||||
'LDFLAGS += -x',
|
||||
]
|
||||
}
|
||||
|
||||
for var, val in expected.items():
|
||||
|
@ -47,3 +47,7 @@ RESFILE = 'bar.res'
|
||||
DEFFILE = 'baz.def'
|
||||
|
||||
USE_STATIC_LIBS = True
|
||||
|
||||
CFLAGS += ['-fno-exceptions', '-w']
|
||||
CXXFLAGS += ['-fcxx-exceptions', '-include foo.h']
|
||||
LDFLAGS += ['-framework Foo', '-x']
|
||||
|
@ -176,6 +176,9 @@ class TestEmitterBasic(unittest.TestCase):
|
||||
RESFILE='bar.res',
|
||||
DEFFILE='baz.def',
|
||||
USE_STATIC_LIBS=True,
|
||||
CFLAGS=['-fno-exceptions', '-w'],
|
||||
CXXFLAGS=['-fcxx-exceptions', '-include foo.h'],
|
||||
LDFLAGS=['-framework Foo', '-x'],
|
||||
)
|
||||
|
||||
variables = objs[0].variables
|
||||
|
Loading…
Reference in New Issue
Block a user