diff options
author | David Tardon <dtardon@redhat.com> | 2012-02-17 15:40:20 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-02-17 15:49:17 +0100 |
commit | a6e47f72dc08669c1600f10e624bb19421cee04b (patch) | |
tree | 643549c47ef12613de37d758031f892183f50454 /solenv | |
parent | 04e1010fd74a8e61d43e83afb81c4f6315a201c8 (diff) |
allow to suppress -Werror per link target
It is implemented for Executable, Library and StaticLibrary and works
for C, C++, Objective C and Objective C++ sources.
Please, do not misuse! Better fix your code!
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/Executable.mk | 1 | ||||
-rw-r--r-- | solenv/gbuild/Library.mk | 1 | ||||
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 9 | ||||
-rw-r--r-- | solenv/gbuild/StaticLibrary.mk | 1 | ||||
-rw-r--r-- | solenv/gbuild/platform/IOS_ARM_GCC.mk | 8 | ||||
-rw-r--r-- | solenv/gbuild/platform/WNT_INTEL_GCC.mk | 5 | ||||
-rw-r--r-- | solenv/gbuild/platform/WNT_INTEL_MSC.mk | 6 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_class.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/platform/macosx.mk | 10 | ||||
-rw-r--r-- | solenv/gbuild/platform/solaris.mk | 6 | ||||
-rw-r--r-- | solenv/gbuild/platform/unxgcc.mk | 4 |
11 files changed, 38 insertions, 15 deletions
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk index 2c5d9ea7791b..2d148a60cdeb 100644 --- a/solenv/gbuild/Executable.mk +++ b/solenv/gbuild/Executable.mk @@ -111,6 +111,7 @@ $(eval $(foreach method,\ add_package_headers \ add_sdi_headers \ add_nativeres \ + set_warnings_not_errors \ ,\ $(call gb_Executable_forward_to_Linktarget,$(method))\ )) diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index 72599c69704c..1b7a2aae9b76 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -181,6 +181,7 @@ $(eval $(foreach method,\ add_sdi_headers \ export_objects_list \ add_nativeres \ + set_warnings_not_errors \ ,\ $(call gb_Library__forward_to_Linktarget,$(method))\ )) diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 227fe96f3c81..3edc66fa490e 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -472,6 +472,7 @@ $(call gb_LinkTarget_get_headers_target,$(1)) \ $(call gb_LinkTarget_get_target,$(1)) : PDBFILE := $(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS := $(call gb_LinkTarget_get_target,$(1)) : NATIVERES := +$(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := ifeq ($(gb_FULLDEPS),$(true)) -include $(call gb_LinkTarget_get_dep_target,$(1)) @@ -494,6 +495,7 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE_STL := $$(gb_LinkTarget_INCL $(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE := $(call gb_LinkTarget_get_dep_target,$(1)) : LIBRARY_X64 := $(call gb_LinkTarget_get_dep_target,$(1)) : EXTRAOBJECTLISTS := +$(call gb_LinkTarget_get_dep_target,$(1)) : WARNINGS_NOT_ERRORS := endif endef @@ -949,5 +951,12 @@ endef gb_LinkTarget_use_externals = \ $(foreach external,$(2),$(call gb_LinkTarget_use_external,$(1),$(external))) +define gb_LinkTarget_set_warnings_not_errors +$(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := $(true) +ifeq ($(gb_FULLDEPS),$(true)) +$(call gb_LinkTarget_get_dep_target,$(1)) : WARNINGS_NOT_ERRORS := $(true) +endif + +endef # vim: set noet sw=4: diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk index 23ceef49d62b..888918c27646 100644 --- a/solenv/gbuild/StaticLibrary.mk +++ b/solenv/gbuild/StaticLibrary.mk @@ -113,6 +113,7 @@ $(eval $(foreach method,\ use_externals \ add_package_headers \ add_sdi_headers \ + set_warnings_not_errors \ ,\ $(call gb_StaticLibrary_forward_to_Linktarget,$(method))\ )) diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk index 4a41bba1a971..429d7dd221ef 100644 --- a/solenv/gbuild/platform/IOS_ARM_GCC.mk +++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk @@ -90,6 +90,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(gb_CXX) \ $(DEFS) \ $(T_OBJCXXFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(1) \ @@ -107,6 +108,7 @@ $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(call gb_ObjCObject_get_dep_target,$(2))) && \ $(gb_CC) \ $(DEFS) $(OBJCFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(call gb_ObjCObject_get_target,$(2)) \ @@ -118,9 +120,9 @@ endef # LinkTarget class -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) -gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) $(gb_OBJCXXFLAGS) $(gb_COMPILEROPTFLAGS) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_COMPILEROPTFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) +gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) $(gb_COMPILEROPTFLAGS) gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) $(gb_COMPILEROPTFLAGS) ifeq ($(gb_SYMBOL),$(true)) diff --git a/solenv/gbuild/platform/WNT_INTEL_GCC.mk b/solenv/gbuild/platform/WNT_INTEL_GCC.mk index d68157035292..e1401db59d29 100644 --- a/solenv/gbuild/platform/WNT_INTEL_GCC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_GCC.mk @@ -129,6 +129,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(gb_CC) \ $(DEFS) \ $(T_CFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -I$(dir $(3)) \ @@ -139,8 +140,8 @@ endef # LinkTarget class -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) ifeq ($(gb_SYMBOL),$(true)) gb_LinkTarget_CXXFLAGS += -ggdb2 diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk index 0fff77fce6e2..9780361c066b 100644 --- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk @@ -279,6 +279,7 @@ $(call gb_Helper_abbreviate_dirs_native,\ $(gb_CC) \ $(DEFS) \ $(T_CFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -Fd$(PDBFILE) \ $(gb_COMPILERDEPFLAGS) \ -I$(realpath $(dir $(3))) \ @@ -297,6 +298,7 @@ $(call gb_Helper_abbreviate_dirs_native,\ $(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), $(gb_CXX)) \ $(DEFS) \ $(T_CXXFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ -Fd$(PDBFILE) \ $(gb_COMPILERDEPFLAGS) \ -I$(realpath $(dir $(3))) \ @@ -322,8 +324,8 @@ endef # LinkTarget class -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) gb_LinkTarget_INCLUDE :=\ $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \ diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index da909489baaf..b8de73e62df5 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -32,6 +32,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(DEFS) \ $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \ $(T_CFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(1) \ @@ -51,6 +52,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(DEFS) \ $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \ $(T_CXXFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(1) \ diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index 13abade7d908..033d32e645a4 100644 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -110,6 +110,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(gb_CXX) \ $(DEFS) \ $(T_OBJCXXFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(1) \ @@ -127,6 +128,7 @@ $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(call gb_ObjCObject_get_dep_target,$(2))) && \ $(gb_CC) \ $(DEFS) $(T_OBJCFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(call gb_ObjCObject_get_target,$(2)) \ @@ -155,10 +157,10 @@ $(if $(3),-install_name '$(3)$(1)$(if $(2),.$(2))', $(call gb_Output_error,cannot determine -install_name for $(3))) endef -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) -gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) $(gb_OBJCXXFLAGS) -gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_OBJCFLAGS) $(gb_COMPILEROPTFLAGS) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) +gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) +gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) $(gb_COMPILEROPTFLAGS) ifeq ($(gb_SYMBOL),$(true)) gb_LinkTarget_CFLAGS += -g diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index c826beae46b7..00021021172f 100644 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -169,6 +169,7 @@ $(call gb_Helper_abbreviate_dirs,\ -xMF $(4) \ $(DEFS) \ $(T_CFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -I$(dir $(3)) \ $(INCLUDE)) endef @@ -183,6 +184,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(gb_CXX) \ $(DEFS) \ $(T_CXXFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -xMMD \ @@ -205,8 +207,8 @@ gb_LinkTarget__RPATHS := \ SDKBIN:\dORIGIN/../../ure-link/lib \ NONE:\dORIGIN/../lib:\dORIGIN \ -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index f533c0495a02..51693c90b9ad 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -200,8 +200,8 @@ gb_LinkTarget__RPATHS := \ SDKBIN:\dORIGIN/../../ure-link/lib \ NONE:\dORIGIN/../lib:\dORIGIN \ -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) ifeq ($(gb_SYMBOL),$(true)) gb_LinkTarget_CXXFLAGS += -ggdb2 |