From 1f6b8a051ce1ef82cab98473f9f9183869106c07 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 21 Oct 2014 12:22:33 -0400 Subject: [PATCH 1/2] Turn off the awful warning stream. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 334524992..7340062ff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,7 @@ #![feature(globs, link_args, managed_boxes, phase, unsafe_destructor)] -#![allow(non_uppercase_statics, non_camel_case_types, non_snake_case_functions)] +#![allow(non_uppercase_statics, non_camel_case_types, non_snake_case, ctypes)] #![reexport_test_harness_main = "test_main"] From d8c13ea3f52259cab21c8300157041ed515c5873 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 21 Oct 2014 12:22:57 -0400 Subject: [PATCH 2/2] Add a non-opt, debug feature. --- Cargo.toml | 3 +++ makefile.cargo | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index f16bed168..2a11129c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,9 @@ authors = ["The Servo Project Developers"] build = "make -f makefile.cargo" +[features] +debugmozjs = ['mozjs-sys/debugmozjs'] + [dependencies.mozjs-sys] git = "https://github.com/servo/mozjs" diff --git a/makefile.cargo b/makefile.cargo index ed3d569f0..4de403688 100644 --- a/makefile.cargo +++ b/makefile.cargo @@ -10,12 +10,16 @@ AR ?= ar endif -CFLAGS += -fPIC +CFLAGS += -fPIC -DJS_NO_JSVAL_JSID_STRUCT_TYPES ifeq ($(shell $(CXX) -v 2>&1 | grep -c 'clang version\|Apple.*clang'),1) CFLAGS += -Wno-c++0x-extensions -Wno-return-type-c-linkage -Wno-invalid-offsetof endif +ifneq (,$(CARGO_FEATURE_DEBUGMOZJS)) + CFLAGS += -g -O0 -DDEBUG -D_DEBUG +endif + MOZJS_OUTDIR = $(shell find $(OUT_DIR)/.. -name 'mozjs-sys-*' -type d) CFLAGS += -I$(MOZJS_OUTDIR)/dist/include