Bug 1025918 - Add support for the .cxx extension to mozbuild. r=ted

This commit is contained in:
Ryan VanderMeulen 2014-06-16 22:36:24 -04:00
parent de07b6927f
commit f2dcba3d01
2 changed files with 15 additions and 2 deletions

View File

@ -1024,6 +1024,10 @@ $(filter %.s,$(CPPSRCS:%.cc=%.s)): %.s: %.cc $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
$(CCC) -S $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
$(filter %.s,$(CPPSRCS:%.cxx=%.s)): %.s: %.cpp $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
$(CCC) -S $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
$(filter %.s,$(CSRCS:%.c=%.s)): %.s: %.c $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
$(CC) -S $(COMPILE_CFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
@ -1039,6 +1043,7 @@ ifneq (,$(filter %.i,$(MAKECMDGOALS)))
_group_srcs = $(sort $(patsubst %.$1,%.i,$(filter %.$1,$2 $(notdir $2))))
_PREPROCESSED_CPP_FILES := $(call _group_srcs,cpp,$(CPPSRCS))
_PREPROCESSED_CC_FILES := $(call _group_srcs,cc,$(CPPSRCS))
_PREPROCESSED_CXX_FILES := $(call _group_srcs,cxx,$(CPPSRCS))
_PREPROCESSED_C_FILES := $(call _group_srcs,c,$(CSRCS))
_PREPROCESSED_CMM_FILES := $(call _group_srcs,mm,$(CMMSRCS))
@ -1048,7 +1053,7 @@ VPATH += $(addprefix $(srcdir)/,$(sort $(dir $(CPPSRCS) $(CSRCS) $(CMMSRCS))))
# Make preprocessed files PHONY so they are always executed, since they are
# manual targets and we don't necessarily write to $@.
.PHONY: $(_PREPROCESSED_CPP_FILES) $(_PREPROCESSED_CC_FILES) $(_PREPROCESSED_C_FILES) $(_PREPROCESSED_CMM_FILES)
.PHONY: $(_PREPROCESSED_CPP_FILES) $(_PREPROCESSED_CC_FILES) $(_PREPROCESSED_CXX_FILES) $(_PREPROCESSED_C_FILES) $(_PREPROCESSED_CMM_FILES)
$(_PREPROCESSED_CPP_FILES): %.i: %.cpp $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
@ -1060,6 +1065,11 @@ $(_PREPROCESSED_CC_FILES): %.i: %.cc $(call mkdir_deps,$(MDDEPDIR))
$(addprefix $(MKDIR) -p ,$(filter-out .,$(@D)))
$(CCC) -C $(PREPROCESS_OPTION)$@ $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
$(_PREPROCESSED_CXX_FILES): %.i: %.cxx $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
$(addprefix $(MKDIR) -p ,$(filter-out .,$(@D)))
$(CCC) -C $(PREPROCESS_OPTION)$@ $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
$(_PREPROCESSED_C_FILES): %.i: %.c $(call mkdir_deps,$(MDDEPDIR))
$(REPORT_BUILD)
$(addprefix $(MKDIR) -p ,$(filter-out .,$(@D)))
@ -1078,7 +1088,7 @@ PP_UNIFIED ?= 1
# infinite loop if the filename doesn't exist in the unified source files.
ifndef PP_REINVOKE
MATCH_cpp = \(cpp\|cc\)
MATCH_cpp = \(cpp\|cc|cxx\)
UPPER_c = C
UPPER_cpp = CPP
UPPER_mm = CMM

View File

@ -276,6 +276,7 @@ class TreeMetadataEmitter(LoggingMixin):
'.mm': 'CMMSRCS',
'.cc': 'CPPSRCS',
'.cpp': 'CPPSRCS',
'.cxx': 'CPPSRCS',
'.S': 'SSRCS',
},
HOST_SOURCES={
@ -283,12 +284,14 @@ class TreeMetadataEmitter(LoggingMixin):
'.mm': 'HOST_CMMSRCS',
'.cc': 'HOST_CPPSRCS',
'.cpp': 'HOST_CPPSRCS',
'.cxx': 'HOST_CPPSRCS',
},
UNIFIED_SOURCES={
'.c': 'UNIFIED_CSRCS',
'.mm': 'UNIFIED_CMMSRCS',
'.cc': 'UNIFIED_CPPSRCS',
'.cpp': 'UNIFIED_CPPSRCS',
'.cxx': 'UNIFIED_CPPSRCS',
}
)
varmap.update(dict(('GENERATED_%s' % k, v) for k, v in varmap.items()