Kaydet (Commit) 8491c5c4 authored tarafından Matúš Kukan's avatar Matúš Kukan

gbuild: one command for C/C++ objects

Change-Id: I835bd56123acfbfb53e0d3d86e5d66b929b3181f
üst 5673bac9
...@@ -27,6 +27,15 @@ ...@@ -27,6 +27,15 @@
# OBJCXXFLAGS # OBJCXXFLAGS
# LDFLAGS # LDFLAGS
# defined by platform
# gb_AsmObject_get_source (.asm on Windows, .s elsewhere)
# gb_AsmObject__command
# gb_CObject__command_pattern
# gb_LinkTarget_CXXFLAGS
# gb_LinkTarget_LDFLAGS
# gb_LinkTarget_INCLUDE
# gb_YaccTarget__command(grammar-file, stem-for-message, source-target, include-target)
# enable if: no "-TARGET" defined AND [module is enabled OR "TARGET" defined] # enable if: no "-TARGET" defined AND [module is enabled OR "TARGET" defined]
gb_LinkTarget__debug_enabled = \ gb_LinkTarget__debug_enabled = \
$(and $(if $(filter -$(1),$(ENABLE_DEBUGINFO_FOR)),,$(true)),\ $(and $(if $(filter -$(1),$(ENABLE_DEBUGINFO_FOR)),,$(true)),\
...@@ -120,15 +129,14 @@ endif ...@@ -120,15 +129,14 @@ endif
# CObject class # CObject class
gb_CObject_get_source = $(1)/$(2).c gb_CObject_get_source = $(1)/$(2).c
# defined by platform
# gb_CObject__command
ifneq ($(COMPILER_PLUGIN_TOOL),) ifneq ($(COMPILER_PLUGIN_TOOL),)
$(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%) $(gb_FORCE_COMPILE_ALL_TARGET) $(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%) $(gb_FORCE_COMPILE_ALL_TARGET)
$(call gb_CObject__tool_command,$*,$<) $(call gb_CObject__tool_command,$*,$<)
else else
$(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%) $(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%)
$(call gb_CObject__command,$@,$*,$<,$(call gb_CObject_get_dep_target,$*)) $(call gb_Output_announce,$*.c,$(true),C ,3)
$(call gb_CObject__command_pattern,$@,$(T_CFLAGS) $(T_CFLAGS_APPEND),$<,$(call gb_CObject_get_dep_target,$*))
endif endif
# Note: if the *Object_dep_target does not exist it will be created by # Note: if the *Object_dep_target does not exist it will be created by
...@@ -143,8 +151,6 @@ endif ...@@ -143,8 +151,6 @@ endif
# CxxObject class # CxxObject class
gb_CxxObject_get_source = $(1)/$(2).cxx gb_CxxObject_get_source = $(1)/$(2).cxx
# defined by platform
# gb_CxxObject__command
# Only enable PCH if the PCH_CXXFLAGS and the PCH_DEFS (from the linktarget) # Only enable PCH if the PCH_CXXFLAGS and the PCH_DEFS (from the linktarget)
# are the same as the T_CXXFLAGS and DEFS we want to use for this object. This # are the same as the T_CXXFLAGS and DEFS we want to use for this object. This
...@@ -174,8 +180,9 @@ $(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,$(SRCDIR),%) ...@@ -174,8 +180,9 @@ $(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,$(SRCDIR),%)
$(call gb_CxxObject__tool_command,$*,$<) $(call gb_CxxObject__tool_command,$*,$<)
else else
$(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,$(SRCDIR),%) $(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,$(SRCDIR),%)
$(call gb_Output_announce,$*.cxx,$(true),CXX,3)
$(eval $(gb_CxxObject__set_pchflags)) $(eval $(gb_CxxObject__set_pchflags))
$(call gb_CxxObject__command,$@,$*,$<,$(call gb_CxxObject_get_dep_target,$*)) $(call gb_CObject__command_pattern,$@,$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND),$<,$(call gb_CxxObject_get_dep_target,$*))
endif endif
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
...@@ -195,12 +202,11 @@ endif ...@@ -195,12 +202,11 @@ endif
# GenCObject class # GenCObject class
gb_GenCObject_get_source = $(WORKDIR)/$(1).c gb_GenCObject_get_source = $(WORKDIR)/$(1).c
# defined by platform
# gb_CObject__command
$(call gb_GenCObject_get_target,%) : $(call gb_GenCObject_get_target,%) :
$(call gb_Output_announce,$*.c,$(true),C ,3)
test -f $(call gb_GenCObject_get_source,$*) || (echo "Missing generated source file $(call gb_GenCObject_get_source,$*)" && false) test -f $(call gb_GenCObject_get_source,$*) || (echo "Missing generated source file $(call gb_GenCObject_get_source,$*)" && false)
$(call gb_CObject__command,$@,$*,$(call gb_GenCObject_get_source,$*),$(call gb_GenCObject_get_dep_target,$*)) $(call gb_CObject__command_pattern,$@,$(T_CFLAGS) $(T_CFLAGS_APPEND),$(call gb_GenCObject_get_source,$*),$(call gb_GenCObject_get_dep_target,$*))
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
$(call gb_GenCObject_get_dep_target,%) : $(call gb_GenCObject_get_dep_target,%) :
...@@ -212,13 +218,12 @@ endif ...@@ -212,13 +218,12 @@ endif
# GenCxxObject class # GenCxxObject class
gb_GenCxxObject_get_source = $(WORKDIR)/$(1).$(gb_LinkTarget_CXX_SUFFIX_$(call gb_LinkTarget__get_workdir_linktargetname,$(2))) gb_GenCxxObject_get_source = $(WORKDIR)/$(1).$(gb_LinkTarget_CXX_SUFFIX_$(call gb_LinkTarget__get_workdir_linktargetname,$(2)))
# defined by platform
# gb_CxxObject__command
$(call gb_GenCxxObject_get_target,%) : $(call gb_GenCxxObject_get_target,%) :
$(call gb_Output_announce,$*.cxx,$(true),CXX,3)
test -f $(GEN_CXX_SOURCE) || (echo "Missing generated source file $(GEN_CXX_SOURCE)" && false) test -f $(GEN_CXX_SOURCE) || (echo "Missing generated source file $(GEN_CXX_SOURCE)" && false)
$(eval $(gb_CxxObject__set_pchflags)) $(eval $(gb_CxxObject__set_pchflags))
$(call gb_CxxObject__command,$@,$*,$(GEN_CXX_SOURCE),$(call gb_GenCxxObject_get_dep_target,$*)) $(call gb_CObject__command_pattern,$@,$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND),$(GEN_CXX_SOURCE),$(call gb_GenCxxObject_get_dep_target,$*))
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
$(call gb_GenCxxObject_get_dep_target,%) : $(call gb_GenCxxObject_get_dep_target,%) :
...@@ -236,8 +241,6 @@ endif ...@@ -236,8 +241,6 @@ endif
# tries to use it. # tries to use it.
gb_YaccTarget_get_source = $(1)/$(2).y gb_YaccTarget_get_source = $(1)/$(2).y
# defined by platform
# gb_YaccTarget__command(grammar-file, stem-for-message, source-target, include-target)
.PHONY : $(call gb_YaccTarget_get_clean_target,%) .PHONY : $(call gb_YaccTarget_get_clean_target,%)
$(call gb_YaccTarget_get_clean_target,%) : $(call gb_YaccTarget_get_clean_target,%) :
...@@ -293,8 +296,6 @@ endef ...@@ -293,8 +296,6 @@ endef
# #
gb_ObjCxxObject_get_source = $(1)/$(2).mm gb_ObjCxxObject_get_source = $(1)/$(2).mm
# defined by platform
# gb_ObjCxxObject__command
ifneq ($(COMPILER_PLUGIN_TOOL),) ifneq ($(COMPILER_PLUGIN_TOOL),)
$(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDIR),%) $(gb_FORCE_COMPILE_ALL_TARGET) $(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDIR),%) $(gb_FORCE_COMPILE_ALL_TARGET)
...@@ -302,7 +303,8 @@ $(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDI ...@@ -302,7 +303,8 @@ $(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDI
else else
$(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDIR),%) $(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDIR),%)
$(call gb_ObjCxxObject__command,$@,$*,$<,$(call gb_ObjCxxObject_get_dep_target,$*)) $(call gb_Output_announce,$*.mm,$(true),OCX,3)
$(call gb_CObject__command_pattern,$@,$(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND),$<,$(call gb_ObjCxxObject_get_dep_target,$*))
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
$(call gb_ObjCxxObject_get_dep_target,%) : $(call gb_ObjCxxObject_get_dep_target,%) :
...@@ -316,8 +318,6 @@ endif ...@@ -316,8 +318,6 @@ endif
# #
gb_ObjCObject_get_source = $(1)/$(2).m gb_ObjCObject_get_source = $(1)/$(2).m
# defined by platform
# gb_ObjCObject__command
ifneq ($(COMPILER_PLUGIN_TOOL),) ifneq ($(COMPILER_PLUGIN_TOOL),)
$(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%) $(gb_FORCE_COMPILE_ALL_TARGET) $(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%) $(gb_FORCE_COMPILE_ALL_TARGET)
...@@ -325,7 +325,8 @@ $(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),% ...@@ -325,7 +325,8 @@ $(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%
else else
$(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%) $(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%)
$(call gb_ObjCObject__command,$@,$*,$<,$(call gb_ObjCObject_get_dep_target,$*)) $(call gb_Output_announce,$*.m,$(true),OCC,3)
$(call gb_CObject__command_pattern,$@,$(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND),$<,$(call gb_ObjCObject_get_dep_target,$*))
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
$(call gb_ObjCObject_get_dep_target,%) : $(call gb_ObjCObject_get_dep_target,%) :
...@@ -337,10 +338,6 @@ endif ...@@ -337,10 +338,6 @@ endif
# AsmObject class # AsmObject class
# defined by platform
# gb_AsmObject_get_source (.asm on Windows, .s elsewhere)
# gb_AsmObject__command
$(call gb_AsmObject_get_target,%) : $(call gb_AsmObject_get_source,$(SRCDIR),%) $(call gb_AsmObject_get_target,%) : $(call gb_AsmObject_get_source,$(SRCDIR),%)
$(call gb_AsmObject__command,$@,$*,$<,$(call gb_AsmObject_get_dep_target,$*)) $(call gb_AsmObject__command,$@,$*,$<,$(call gb_AsmObject_get_dep_target,$*))
...@@ -365,11 +362,6 @@ define gb_LinkTarget_rtl_defs ...@@ -365,11 +362,6 @@ define gb_LinkTarget_rtl_defs
$(if $(filter-out sal salhelper cppu cppuhelper odk, $(gb_Module_CURRENTMODULE_NAME)), -DRTL_USING) $(if $(filter-out sal salhelper cppu cppuhelper odk, $(gb_Module_CURRENTMODULE_NAME)), -DRTL_USING)
endef endef
# defined by platform
# gb_LinkTarget_CXXFLAGS
# gb_LinkTarget_LDFLAGS
# gb_LinkTarget_INCLUDE
.PHONY : $(WORKDIR)/Clean/LinkTarget/% .PHONY : $(WORKDIR)/Clean/LinkTarget/%
$(WORKDIR)/Clean/LinkTarget/% : $(WORKDIR)/Clean/LinkTarget/% :
$(call gb_Output_announce,$*,$(false),LNK,4) $(call gb_Output_announce,$*,$(false),LNK,4)
...@@ -1142,7 +1134,7 @@ endef ...@@ -1142,7 +1134,7 @@ endef
# call gb_LinkTarget_add_x64_generated_cobjects,linktarget,sourcefiles,cflags,linktargetmakefilename # call gb_LinkTarget_add_x64_generated_cobjects,linktarget,sourcefiles,cflags,linktargetmakefilename
define gb_LinkTarget_add_x64_generated_cobjects define gb_LinkTarget_add_x64_generated_cobjects
$(foreach obj,$(2),$(call gb_LinkTarget_add_generated_c_object,$(1),$(obj),$(3),$(4))) $(foreach obj,$(2),$(call gb_LinkTarget_add_generated_c_object,$(1),$(obj),$(3),$(4)))
$(foreach obj,$(2),$(eval $(call gb_GenCObject_get_target,$(obj)) : COBJECT_X64 := YES)) $(foreach obj,$(2),$(eval $(call gb_GenCObject_get_target,$(obj)) : CXXOBJECT_X64 := YES))
endef endef
# call gb_LinkTarget_add_generated_cxxobjects,linktarget,sourcefiles,cxxflags,linktargetmakefilename # call gb_LinkTarget_add_generated_cxxobjects,linktarget,sourcefiles,cxxflags,linktargetmakefilename
......
...@@ -42,24 +42,24 @@ endef ...@@ -42,24 +42,24 @@ endef
# CObject class # CObject class
# $(call gb_CObject__command,object,relative-source,source,dep-file) # $(call gb_CObject__command_pattern,object,flags,source,dep-file)
define gb_CObject__command define gb_CObject__command_pattern
$(call gb_Output_announce,$(2).c,$(true),C ,3)
$(call gb_Helper_abbreviate_dirs,\ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \ mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \
$(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS_SETUP)) \ $(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS_SETUP)) \
$(gb_CC) \ $(if $(filter %.c %.m,$(3)), $(gb_CC), $(gb_CXX)) \
$(DEFS) \ $(DEFS) \
$(gb_LTOFLAGS) \ $(gb_LTOFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \ $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
$(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS)) \ $(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS)) \
$(T_CFLAGS) $(T_CFLAGS_APPEND) \ $(2) \
-c $(3) \ -c $(3) \
-o $(1) \ -o $(1) \
$(call gb_cxx_dep_generation_options,$(1),$(4)) \ $(call gb_cxx_dep_generation_options,$(1),$(4)) \
-I$(dir $(3)) \ -I$(dir $(3)) \
$(INCLUDE) \ $(INCLUDE) \
$(PCHFLAGS) \
$(call gb_cxx_dep_copy,$(4)) \ $(call gb_cxx_dep_copy,$(4)) \
) )
endef endef
...@@ -83,31 +83,6 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -83,31 +83,6 @@ $(call gb_Helper_abbreviate_dirs,\
) )
endef endef
# CxxObject class
# $(call gb_CxxObject__command,object,relative-source,source,dep-file)
define gb_CxxObject__command
$(call gb_Output_announce,$(2).cxx,$(true),CXX,3)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \
$(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS_SETUP)) \
$(gb_CXX) \
$(DEFS) \
$(gb_LTOFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \
$(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS)) \
$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \
-c $(3) \
-o $(1) \
$(call gb_cxx_dep_generation_options,$(1),$(4)) \
-I$(dir $(3)) \
$(INCLUDE) \
$(PCHFLAGS) \
$(call gb_cxx_dep_copy,$(4)) \
)
endef
# Used to run a compiler plugin tool. # Used to run a compiler plugin tool.
# $(call gb_CxxObject__tool_command,relative-source,source) # $(call gb_CxxObject__tool_command,relative-source,source)
define gb_CxxObject__tool_command define gb_CxxObject__tool_command
...@@ -118,7 +93,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -118,7 +93,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(DEFS) \ $(DEFS) \
$(gb_LTOFLAGS) \ $(gb_LTOFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \ $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
$(gb_COMPILER_PLUGINS) \ $(gb_COMPILER_PLUGINS) \
$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \ $(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \
-c $(2) \ -c $(2) \
...@@ -127,44 +102,6 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -127,44 +102,6 @@ $(call gb_Helper_abbreviate_dirs,\
) )
endef endef
# ObjCxxObject class
define gb_ObjCxxObject__command
$(call gb_Output_announce,$(2).mm,$(true),OCX,3)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && \
$(gb_CXX) \
$(DEFS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \
$(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND) \
-c $(3) \
-o $(1) \
-MMD -MT $(1) \
-MP -MF $(4) \
-I$(dir $(3)) \
$(INCLUDE))
endef
# ObjCObject class
define gb_ObjCObject__command
$(call gb_Output_announce,$(2).m,$(true),OCC,3)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && \
$(gb_CC) \
$(DEFS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
$(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND) \
-c $(3) \
-o $(1) \
-MMD -MT $(1) \
-MP -MF $(4) \
-I$(dir $(3)) \
$(INCLUDE))
endef
define gb_SrsPartTarget__command_dep define gb_SrsPartTarget__command_dep
$(call gb_Helper_abbreviate_dirs,\ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(call gb_SrsPartTarget_get_dep_target,$(1))) && cd $(SRCDIR) && \ mkdir -p $(dir $(call gb_SrsPartTarget_get_dep_target,$(1))) && cd $(SRCDIR) && \
......
...@@ -92,10 +92,7 @@ gb_CXXFLAGS_COMMON += -fvisibility-inlines-hidden ...@@ -92,10 +92,7 @@ gb_CXXFLAGS_COMMON += -fvisibility-inlines-hidden
endif endif
endif endif
ifneq ($(ENABLE_WERROR),) gb_CFLAGS_WERROR := $(if $(ENABLE_WERROR),-Werror)
gb_CFLAGS_WERROR := -Werror
gb_CXXFLAGS_WERROR := -Werror
endif
ifneq ($(MERGELIBS),) ifneq ($(MERGELIBS),)
gb_CFLAGS_COMMON += -DLIBO_MERGELIBS gb_CFLAGS_COMMON += -DLIBO_MERGELIBS
......
...@@ -34,41 +34,18 @@ endef ...@@ -34,41 +34,18 @@ endef
# CObject class # CObject class
# $(call gb_CObject__command,object,relative-source,source,dep-file) # $(call gb_CObject__command_pattern,object,flags,source,dep-file)
define gb_CObject__command define gb_CObject__command_pattern
$(call gb_Output_announce,$(2).c,$(true),C ,3)
$(call gb_Helper_abbreviate_dirs,\ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && \ mkdir -p $(dir $(1)) $(dir $(4)) && \
unset INCLUDE && \ unset INCLUDE && \
$(if $(filter YES,$(COBJECT_X64)), $(CXX_X64_BINARY), $(gb_CC)) \ $(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), \
$(if $(filter %.c,$(3)), $(gb_CC), $(gb_CXX))) \
$(DEFS) \ $(DEFS) \
$(gb_LTOFLAGS) \ $(gb_LTOFLAGS) \
$(T_CFLAGS) $(T_CFLAGS_APPEND) \ $(2) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
-Fd$(PDBFILE) \ -Fd$(PDBFILE) \
$(gb_COMPILERDEPFLAGS) \
-I$(dir $(3)) \
$(INCLUDE) \
$(if $(filter YES,$(COBJECT_X64)), -U_X86_ -D_AMD64_,) \
-c $(3) \
-Fo$(1)) $(call gb_create_deps,$(4),$(1),$(3))
endef
# CxxObject class
# $(call gb_CxxObject__command,object,relative-source,source,dep-file)
define gb_CxxObject__command
$(call gb_Output_announce,$(2).cxx,$(true),CXX,3)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && \
unset INCLUDE && \
$(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), $(gb_CXX)) \
$(DEFS) \
$(gb_LTOFLAGS) \
$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \
-Fd$(PDBFILE) \
$(PCHFLAGS) \ $(PCHFLAGS) \
$(gb_COMPILERDEPFLAGS) \ $(gb_COMPILERDEPFLAGS) \
-I$(dir $(3)) \ -I$(dir $(3)) \
...@@ -78,7 +55,6 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -78,7 +55,6 @@ $(call gb_Helper_abbreviate_dirs,\
-Fo$(1)) $(call gb_create_deps,$(4),$(1),$(3)) -Fo$(1)) $(call gb_create_deps,$(4),$(1),$(3))
endef endef
# PrecompiledHeader class # PrecompiledHeader class
# Note: MSVC has a race condition when dealing with .pdb files, that can result in error C1033 when # Note: MSVC has a race condition when dealing with .pdb files, that can result in error C1033 when
......
...@@ -244,10 +244,7 @@ gb_PCHWARNINGS = \ ...@@ -244,10 +244,7 @@ gb_PCHWARNINGS = \
gb_STDLIBS := \ gb_STDLIBS := \
advapi32.lib \ advapi32.lib \
ifneq ($(ENABLE_WERROR),) gb_CFLAGS_WERROR := $(if $(ENABLE_WERROR),-WX)
gb_CFLAGS_WERROR := -WX
gb_CXXFLAGS_WERROR := -WX
endif
ifneq ($(MERGELIBS),) ifneq ($(MERGELIBS),)
gb_CFLAGS += -DLIBO_MERGELIBS gb_CFLAGS += -DLIBO_MERGELIBS
......
...@@ -149,7 +149,7 @@ gb_LinkTarget__RPATHS := \ ...@@ -149,7 +149,7 @@ gb_LinkTarget__RPATHS := \
NONE:\dORIGIN/../Library \ NONE:\dORIGIN/../Library \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CFLAGS_WERROR)
ifeq ($(gb_SYMBOL),$(true)) ifeq ($(gb_SYMBOL),$(true))
gb_LinkTarget_CXXFLAGS += -ggdb2 gb_LinkTarget_CXXFLAGS += -ggdb2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment