add and deal with -fvisibility=hidden everywhere
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 453cc61..3945440 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,12 @@
 	message(FATAL_ERROR "libdrm not found")
 endif()
 
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Werror -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter")
+if (CMAKE_COMPILER_IS_GNUCC)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Werror -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter")
+    if (UNIX)
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+    endif()
+endif()
 
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
 include(GetGitRevisionDescription)