From 13ea1767697d890a5d4289eec9cacf1f66037cb7 Mon Sep 17 00:00:00 2001 From: Chris Manchester Date: Tue, 8 Aug 2017 15:43:04 -0700 Subject: [PATCH] Bug 1380547 - Add a variable other than DEFINES for defines that are set from Makefiles. r=mshal As we move our compile command lines into mozbuild we want to stop using DEFINES directly. This patch adds a variable that can be set from Makefiles to contribute defines to a compile command line to help the transition. MozReview-Commit-ID: 5xLB06pzpJY --HG-- extra : rebase_source : 7ca0b9d8f5a77ec55eb751f75f58a69e64efb21d --- config/config.mk | 4 ++-- toolkit/xre/Makefile.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/config.mk b/config/config.mk index c4418e7a3549..4fa60e662975 100644 --- a/config/config.mk +++ b/config/config.mk @@ -328,8 +328,8 @@ CXXFLAGS += $(WARNINGS_AS_ERRORS) CFLAGS += $(WARNINGS_AS_ERRORS) endif # ALLOW_COMPILER_WARNINGS -COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS) $(_DEPEND_CFLAGS) $(CFLAGS) $(MOZBUILD_CFLAGS) -COMPILE_CXXFLAGS = $(if $(DISABLE_STL_WRAPPING),,$(STL_FLAGS)) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS) $(_DEPEND_CFLAGS) $(CXXFLAGS) $(MOZBUILD_CXXFLAGS) +COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS) $(_DEPEND_CFLAGS) $(CFLAGS) $(MOZBUILD_CFLAGS) $(MK_COMPILE_DEFINES) +COMPILE_CXXFLAGS = $(if $(DISABLE_STL_WRAPPING),,$(STL_FLAGS)) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS) $(_DEPEND_CFLAGS) $(CXXFLAGS) $(MOZBUILD_CXXFLAGS) $(MK_COMPILE_DEFINES) COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS) $(MOZBUILD_CMFLAGS) COMPILE_CMMFLAGS = $(OS_COMPILE_CMMFLAGS) $(MOZBUILD_CMMFLAGS) ASFLAGS += $(MOZBUILD_ASFLAGS) diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in index 225dc3bbb6ee..c40afc243bf8 100644 --- a/toolkit/xre/Makefile.in +++ b/toolkit/xre/Makefile.in @@ -12,10 +12,10 @@ include $(topsrcdir)/config/rules.mk MOZ_BUILDID := $(shell awk '{print $$3}' $(DEPTH)/buildid.h) $(call errorIfEmpty,GRE_MILESTONE MOZ_BUILDID) +MK_COMPILE_DEFINES = -DMOZ_BUILDID=$(MOZ_BUILDID) + # Note these dependencies are broken because the target is *not* the cpp file. # BUT, actually fixing it would make libxul rebuilt on every single incremental # build because of the automatic buildid change. This is why we can't actually # include buildid.h there, because it would add the dependency. $(srcdir)/nsAppRunner.cpp: $(DEPTH)/buildid.h $(milestone_txt) - -nsAppRunner.$(OBJ_SUFFIX): DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID)