add VISIBILITY_HIDDEN cmake option
to allow building with -fvisibility=hidden -fvisibility-inlines-hidden
@@ -179,6 +179,12 @@ option(POCL_ICD_ABSOLUTE_PATH "Use absolute path in pocl.icd" ON)
option(ENABLE_POCL_BUILDING "When OFF, env var POCL_BUILDING has no effect. Defaults to ON" ON)
+option(VISIBILITY_HIDDEN "Build with -fvisibility=hidden -fvisibility-inlines-hidden" OFF)
+if(VISIBILITY_HIDDEN)
+ add_compile_options(-fvisibility=hidden)
+ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fvisibility-inlines-hidden>)
+endif()
+
#### these are mostly useful for pocl developers
option(DEVELOPER_MODE "This will SIGNIFICANTLY slow down pocl (but speed up its compilation). Only turn on if you know what you're doing." OFF)
