| 1 |
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- |
| 2 |
# vim: set filetype=python: |
| 3 |
# This Source Code Form is subject to the terms of the Mozilla Public |
| 4 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 |
|
| 7 |
FINAL_LIBRARY = "js" |
| 8 |
|
| 9 |
# Includes should be relative to parent path |
| 10 |
LOCAL_INCLUDES += ["!..", ".."] |
| 11 |
|
| 12 |
include("../js-config.mozbuild") |
| 13 |
include("../js-cxxflags.mozbuild") |
| 14 |
|
| 15 |
|
| 16 |
# Generate frontend/ReservedWordsGenerated.h from frontend/ReservedWords.h |
| 17 |
flags = [] |
| 18 |
if CONFIG["ENABLE_DECORATORS"]: |
| 19 |
flags.append("--enable-decorators") |
| 20 |
if CONFIG["ENABLE_EXPLICIT_RESOURCE_MANAGEMENT"]: |
| 21 |
flags.append("--enable-explicit-resource-management") |
| 22 |
if flags: |
| 23 |
GeneratedFile( |
| 24 |
"ReservedWordsGenerated.h", |
| 25 |
script="GenerateReservedWords.py", |
| 26 |
inputs=["ReservedWords.h"], |
| 27 |
flags=flags, |
| 28 |
) |
| 29 |
else: |
| 30 |
GeneratedFile( |
| 31 |
"ReservedWordsGenerated.h", |
| 32 |
script="GenerateReservedWords.py", |
| 33 |
inputs=["ReservedWords.h"], |
| 34 |
) |
| 35 |
|
| 36 |
UNIFIED_SOURCES += [ |
| 37 |
"AbstractScopePtr.cpp", |
| 38 |
"AsyncEmitter.cpp", |
| 39 |
"BytecodeCompiler.cpp", |
| 40 |
"BytecodeControlStructures.cpp", |
| 41 |
"BytecodeEmitter.cpp", |
| 42 |
"BytecodeSection.cpp", |
| 43 |
"CallOrNewEmitter.cpp", |
| 44 |
"CForEmitter.cpp", |
| 45 |
"DefaultEmitter.cpp", |
| 46 |
"DoWhileEmitter.cpp", |
| 47 |
"ElemOpEmitter.cpp", |
| 48 |
"EmitterScope.cpp", |
| 49 |
"ExpressionStatementEmitter.cpp", |
| 50 |
"FoldConstants.cpp", |
| 51 |
"ForInEmitter.cpp", |
| 52 |
"ForOfEmitter.cpp", |
| 53 |
"ForOfLoopControl.cpp", |
| 54 |
"FrontendContext.cpp", |
| 55 |
"FunctionEmitter.cpp", |
| 56 |
"IfEmitter.cpp", |
| 57 |
"JumpList.cpp", |
| 58 |
"LabelEmitter.cpp", |
| 59 |
"LexicalScopeEmitter.cpp", |
| 60 |
"NameFunctions.cpp", |
| 61 |
"NameOpEmitter.cpp", |
| 62 |
"ObjectEmitter.cpp", |
| 63 |
"ObjLiteral.cpp", |
| 64 |
"OptionalEmitter.cpp", |
| 65 |
"ParseContext.cpp", |
| 66 |
"ParseNode.cpp", |
| 67 |
"ParseNodeVerify.cpp", |
| 68 |
"ParserAtom.cpp", |
| 69 |
"PrivateOpEmitter.cpp", |
| 70 |
"PropOpEmitter.cpp", |
| 71 |
"SharedContext.cpp", |
| 72 |
"SourceNotes.cpp", |
| 73 |
"Stencil.cpp", |
| 74 |
"StencilXdr.cpp", |
| 75 |
"SwitchEmitter.cpp", |
| 76 |
"TDZCheckCache.cpp", |
| 77 |
"TokenStream.cpp", |
| 78 |
"TryEmitter.cpp", |
| 79 |
"WhileEmitter.cpp", |
| 80 |
] |
| 81 |
|
| 82 |
if CONFIG["ENABLE_DECORATORS"]: |
| 83 |
UNIFIED_SOURCES += [ |
| 84 |
"DecoratorEmitter.cpp", |
| 85 |
] |
| 86 |
|
| 87 |
if CONFIG["ENABLE_EXPLICIT_RESOURCE_MANAGEMENT"]: |
| 88 |
UNIFIED_SOURCES += [ |
| 89 |
"UsingEmitter.cpp", |
| 90 |
] |
| 91 |
|
| 92 |
# Parser.cpp cannot be built in unified mode because of explicit |
| 93 |
# template instantiations. |
| 94 |
SOURCES += [ |
| 95 |
"Parser.cpp", |
| 96 |
] |
| 97 |
|
| 98 |
if CONFIG["FUZZING_INTERFACES"] and CONFIG["LIBFUZZER"]: |
| 99 |
include("/tools/fuzzing/libfuzzer-config.mozbuild") |