summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Hanwell <marcus.hanwell@kitware.com>2010-01-06 17:00:36 (GMT)
committerMarcus Hanwell <marcus.hanwell@kitware.com>2010-01-06 17:00:36 (GMT)
commitb0a0714343b786efd0ce81a07ed14fdf24567db8 (patch)
treec204ba2645114f6669d51423399f27502b18118e
parent4671b39363a5bd11b1403e148496a85eb1121453 (diff)
downloadCMake-b0a0714343b786efd0ce81a07ed14fdf24567db8.zip
CMake-b0a0714343b786efd0ce81a07ed14fdf24567db8.tar.gz
CMake-b0a0714343b786efd0ce81a07ed14fdf24567db8.tar.bz2
ENH: Added support for building kwsys with GCC visibility support.
When kwsys is built using GCC visibility support can be used. This is similar to the way that Windows exports symbols in DLLs, and requires projects that build kwsys to change the default visibility using some compiler flags. See http://gcc.gnu.org/wiki/Visibility for more details about GCC visibility.
-rw-r--r--Source/kwsys/Configure.h.in14
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/kwsys/Configure.h.in b/Source/kwsys/Configure.h.in
index b57b698..e3fa4c7 100644
--- a/Source/kwsys/Configure.h.in
+++ b/Source/kwsys/Configure.h.in
@@ -88,11 +88,15 @@
#endif
/* Setup the export macro. */
-#if defined(_WIN32) && @KWSYS_BUILD_SHARED@
-# if defined(@KWSYS_NAMESPACE@_EXPORTS)
-# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllexport)
-# else
-# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllimport)
+#if @KWSYS_BUILD_SHARED@
+# if defined(_WIN32) || defined(__CYGWIN__)
+# if defined(@KWSYS_NAMESPACE@_EXPORTS)
+# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllexport)
+# else
+# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllimport)
+# endif
+# elif __GNUC__ >= 4
+# define @KWSYS_NAMESPACE@_EXPORT __attribute__ ((visibility("default")))
# endif
#else
# define @KWSYS_NAMESPACE@_EXPORT