summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJohn Stamp <jstamp@users.sourceforge.net>2010-07-28 15:36:33 -0700
committerLloyd Hilaiel <lloyd@hilaiel.com>2010-08-10 11:54:25 -0600
commit0915ba9cb5b469e3d186227ebbecdae6c259d0c2 (patch)
tree0459026f5eb3577580e4a266d9234db67ef00b09 /CMakeLists.txt
parent8a6bb359a240b4e651ba260ab7719821695974f4 (diff)
downloadyajl-0915ba9cb5b469e3d186227ebbecdae6c259d0c2.tar.gz
Don't export private symbols
Signed-off-by: Lloyd Hilaiel <lloyd@hilaiel.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc6bfbd..727a488 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,6 +62,13 @@ IF (WIN32)
SET(CMAKE_C_FLAGS_DEBUG "/D DEBUG /Od /Z7")
SET(CMAKE_C_FLAGS_RELEASE "/D NDEBUG /O2")
ELSE (WIN32)
+ IF(CMAKE_COMPILER_IS_GNUCC)
+ INCLUDE(CheckCCompilerFlag)
+ CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_GCC_VISIBILITY)
+ IF(HAVE_GCC_VISIBILITY)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+ ENDIF(HAVE_GCC_VISIBILITY)
+ ENDIF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -std=c99 -pedantic -Wpointer-arith -Wno-format-y2k -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -Wextra -Wundef -Wwrite-strings -Wold-style-definition -Wredundant-decls -Wno-unused-parameter -Wno-sign-compare -Wmissing-prototypes")