diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-09-20 14:43:40 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-09-22 08:13:41 +0200 |
commit | 17924c4aa5eb66465986cce97e975a13546d4eb6 (patch) | |
tree | f56fc4a07ca3ae029958759d2e5d0aab89a35407 /solenv/gbuild | |
parent | fc0aa44b9d6aab7af68b00e4e26f3d9300e30fc2 (diff) |
allow Library to disable hidden visibility
Change-Id: I1f676b7536183f68795595f216ae23610cadb1eb
Diffstat (limited to 'solenv/gbuild')
-rw-r--r-- | solenv/gbuild/Library.mk | 1 | ||||
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 10 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_class.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_defs.mk | 7 | ||||
-rw-r--r-- | solenv/gbuild/platform/macosx.mk | 20 | ||||
-rw-r--r-- | solenv/gbuild/platform/solaris.mk | 18 | ||||
-rw-r--r-- | solenv/gbuild/platform/unxgcc.mk | 18 |
7 files changed, 22 insertions, 54 deletions
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index 4dc30b037849..ff478b4b74e2 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -217,6 +217,7 @@ $(eval $(foreach method,\ add_sdi_headers \ export_objects_list \ add_nativeres \ + set_visibility_default \ set_warnings_not_errors \ set_generated_cxx_suffix \ ,\ diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 96178bcc6c73..3c670e80a835 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -493,6 +493,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)) : VISIBILITY := $(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := ifeq ($(gb_FULLDEPS),$(true)) @@ -516,6 +517,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)) : VISIBILITY := $(call gb_LinkTarget_get_dep_target,$(1)) : WARNINGS_NOT_ERRORS := endif @@ -1102,6 +1104,14 @@ endef gb_LinkTarget_use_externals = \ $(foreach external,$(2),$(call gb_LinkTarget_use_external,$(1),$(external))) +define gb_LinkTarget_set_visibility_default +$(call gb_LinkTarget_get_target,$(1)) : VISIBILITY := default +ifeq ($(gb_FULLDEPS),$(true)) +$(call gb_LinkTarget_get_dep_target,$(1)) : VISIBILITY := default +endif + +endef + define gb_LinkTarget_set_warnings_not_errors $(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := $(true) ifeq ($(gb_FULLDEPS),$(true)) diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index 18a389e4dd23..630eed78c560 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -58,6 +58,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(gb_CC) \ $(DEFS) \ $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \ + $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(T_CFLAGS) \ -c $(3) \ @@ -79,6 +80,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(gb_CXX) \ $(DEFS) \ $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \ + $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ $(T_CXXFLAGS) \ -c $(3) \ diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index c851b744bf46..1b606a0e2ce5 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -79,6 +79,13 @@ gb_CXXFLAGS_COMMON := \ -fno-common \ -pipe \ +ifeq ($(HAVE_GCC_VISIBILITY_FEATURE),TRUE) +gb_VISIBILITY_FLAGS := -DHAVE_GCC_VISIBILITY_FEATURE -fvisibility=hidden +ifneq ($(HAVE_GCC_VISIBILITY_BROKEN),TRUE) +gb_CXXFLAGS_COMMON += -fvisibility-inlines-hidden +endif +endif + ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE) gb_CFLAGS_WERROR := -Werror -DLIBO_WERROR gb_CXXFLAGS_WERROR := -Werror -DLIBO_WERROR diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index 93cc45097dfe..4d5594b986e0 100644 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -69,24 +69,6 @@ gb_CXXFLAGS := \ #-fsigned-char \ might be removed? #-malign-natural \ might be removed? -ifeq ($(HAVE_GCC_VISIBILITY_FEATURE),TRUE) -gb_COMPILERDEFS += \ - -DHAVE_GCC_VISIBILITY_FEATURE \ - -gb_CFLAGS += \ - -fvisibility=hidden - -gb_CXXFLAGS += \ - -fvisibility=hidden \ - -ifneq ($(HAVE_GCC_VISIBILITY_BROKEN),TRUE) -gb_CXXFLAGS += \ - -fvisibility-inlines-hidden \ - -endif - -endif - ifeq ($(HAVE_SFINAE_ANONYMOUS_BROKEN),TRUE) gb_COMPILERDEFS += \ -DHAVE_SFINAE_ANONYMOUS_BROKEN \ @@ -124,6 +106,7 @@ $(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) \ -c $(3) \ @@ -142,6 +125,7 @@ $(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) \ -c $(3) \ diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index 7dcf498eec08..adb1a61db15c 100644 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -79,24 +79,6 @@ gb_CXXFLAGS := \ -Woverloaded-virtual \ -Wno-non-virtual-dtor \ -ifeq ($(HAVE_GCC_VISIBILITY_FEATURE),TRUE) -gb_COMPILERDEFS += \ - -DHAVE_GCC_VISIBILITY_FEATURE \ - -gb_CFLAGS += \ - -fvisibility=hidden - -gb_CXXFLAGS += \ - -fvisibility=hidden \ - -ifneq ($(HAVE_GCC_VISIBILITY_BROKEN),TRUE) -gb_CXXFLAGS += \ - -fvisibility-inlines-hidden \ - -endif - -endif - # enable debug STL ifeq ($(gb_PRODUCT),$(false)) gb_COMPILERDEFS += \ diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index 392de3e2e3b2..387980205b59 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -78,24 +78,6 @@ else gb_CXXFLAGS += -Wnon-virtual-dtor endif -ifeq ($(HAVE_GCC_VISIBILITY_FEATURE),TRUE) -gb_COMPILERDEFS += \ - -DHAVE_GCC_VISIBILITY_FEATURE \ - -gb_CFLAGS += \ - -fvisibility=hidden - -gb_CXXFLAGS += \ - -fvisibility=hidden \ - -ifneq ($(HAVE_GCC_VISIBILITY_BROKEN),TRUE) -gb_CXXFLAGS += \ - -fvisibility-inlines-hidden \ - -endif - -endif - ifeq ($(HAVE_SFINAE_ANONYMOUS_BROKEN),TRUE) gb_COMPILERDEFS += \ -DHAVE_SFINAE_ANONYMOUS_BROKEN \ |