Bug 1454613 - Build binsource when building SpiderMonkey
MozReview-Commit-ID: CBy5fIgY6Ty
--- a/js/src/Cargo.toml
+++ b/js/src/Cargo.toml
@@ -14,8 +14,12 @@ name = "mozjs_sys"
path = "lib.rs"
[build-dependencies]
num_cpus = "1.1.0"
[dependencies]
libc = "0.2"
libz-sys = "1.0.16"
+
+[[bin]]
+name = "binsource"
+path = "frontend/binsource"
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -705,16 +705,21 @@ if CONFIG['JS_BUILD_BINAST']:
# specification.
SOURCES += ['frontend/BinTokenReaderTester.cpp']
# These parts of BinAST should eventually move to release.
SOURCES += [
'frontend/BinSource-auto.cpp',
'frontend/BinSource.cpp',
'frontend/BinToken.cpp'
]
+ # The following is a sanity check to ensure that we do not break builds of
+ # the parser generator, even if we don't use it at build-time yet.
+ RUST_PROGRAMS += [
+ 'binsource'
+ ]
# Instrument BinAST files for fuzzing as we have a fuzzing target for BinAST.
if CONFIG['FUZZING_INTERFACES'] and CONFIG['LIBFUZZER']:
SOURCES['frontend/BinSource.cpp'].flags += libfuzzer_flags_cmp
SOURCES['frontend/BinToken.cpp'].flags += libfuzzer_flags_cmp
SOURCES['frontend/BinTokenReaderTester.cpp'].flags += libfuzzer_flags_cmp
# Wasm code should use WASM_HUGE_MEMORY instead of JS_CODEGEN_X64