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 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"]