From: Chow Loong Jin <hyperair@debian.org>
Date: Wed, 19 Mar 2014 11:12:54 +0800
Subject: Use -fvisibility to control exporting of symbols

---
 CMakeLists.txt | 5 +++++
 tinyxml2.h     | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15969de..40ce070 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,6 +57,11 @@ set_target_properties(tinyxml2 PROPERTIES
 	VERSION "${GENERIC_LIB_VERSION}"
 	SOVERSION "${GENERIC_LIB_SOVERSION}")
 
+if(UNIX)
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+endif(UNIX)
+
+
 add_executable(test xmltest.cpp)
 add_dependencies(test tinyxml2)
 add_dependencies(test ${TARGET_DATA_COPY})
diff --git a/tinyxml2.h b/tinyxml2.h
index cb1dc1b..245b088 100755
--- a/tinyxml2.h
+++ b/tinyxml2.h
@@ -71,6 +71,8 @@ distribution.
 #   else
 #       define TINYXML2_LIB
 #   endif
+#elif (defined( __GNUC__ ) || defined( __clang__)) && defined( TINYXML2_EXPORT )
+#   define TINYXML2_LIB __attribute__((visibility( "default" )))
 #else
 #   define TINYXML2_LIB
 #endif
