CFG_INFO := $(info cfg: non host triples $(NON_HOST_TRIPLES))
endif
+CFG_RUSTC_FLAGS :=
+CFG_GCCISH_CFLAGS :=
+CFG_GCCISH_LINK_FLAGS :=
+
ifdef CFG_DISABLE_OPTIMIZE
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
- CFG_RUSTC_FLAGS :=
+ CFG_RUSTC_FLAGS +=
else
- CFG_RUSTC_FLAGS := -O
+ CFG_RUSTC_FLAGS += -O
+endif
+
+ifdef CFG_ENABLE_DEBUG
+ $(info cfg: enabling more debugging (CFG_ENABLE_DEBUG))
+ CFG_RUSTC_FLAGS += -g --cfg=debug
+ CFG_GCCISH_CFLAGS += -DRUST_DEBUG
+else
+ CFG_RUSTC_FLAGS += --cfg=ndebug
+ CFG_GCCISH_CFLAGS += -DRUST_NDEBUG
endif
ifdef SAVE_TEMPS
ifdef TIME_LLVM_PASSES
CFG_RUSTC_FLAGS += --time-llvm-passes
endif
-ifdef DEBUG
- CFG_RUSTC_FLAGS += -g
-endif
# platform-specific auto-configuration
include $(CFG_SRC_DIR)mk/platform.mk
opt optimize 1 "build optimized rust code"
opt optimize-cxx 1 "build optimized C++ code"
opt optimize-llvm 1 "build optimized LLVM"
+opt debug 0 "build with extra debug fun"
opt fast-make 0 "use .gitmodules as timestamp for submodule deps"
opt manage-submodules 1 "let the build manage the git submodules"
opt mingw-cross 0 "cross-compile for win32 using mingw"
$(foreach t,$(CFG_TARGET_TRIPLES),$(eval $(call DEF_HOST_VAR,$(t))))
$(foreach t,$(CFG_TARGET_TRIPLES),$(info cfg: host for $(t) is $(HOST_$(t))))
-CFG_GCCISH_FLAGS := -fno-strict-aliasing
-CFG_GCCISH_LINK_FLAGS :=
+CFG_GCCISH_FLAGS += -fno-strict-aliasing
# On Darwin, we need to run dsymutil so the debugging information ends
# up in the right place. On other platforms, it automatically gets