yolobs-studio/debian/patches/0002-Hide-internal-symbols.patch
Sebastian Ramacher ee8987800e Refresh patches
2020-12-22 18:34:09 +01:00

62 lines
1.7 KiB
Diff

From: Sebastian Ramacher <sramacher@debian.org>
Date: Wed, 19 Apr 2017 21:45:40 +0200
Subject: Hide internal symbols
---
deps/obs-scripting/CMakeLists.txt | 12 ++++++++++++
libobs/CMakeLists.txt | 5 +++++
libobs/util/c99defs.h | 2 +-
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/deps/obs-scripting/CMakeLists.txt b/deps/obs-scripting/CMakeLists.txt
index 42558be..e54f95c 100644
--- a/deps/obs-scripting/CMakeLists.txt
+++ b/deps/obs-scripting/CMakeLists.txt
@@ -196,6 +196,18 @@ add_library(obs-scripting SHARED
${SWIG_LUA_RUNTIME}
)
+if(UNIX)
+ set_source_files_properties(${obs-scripting_SOURCES}
+ ${obs-scripting_HEADERS}
+ ${obs-scripting-python_SOURCES}
+ ${obs-scripting-python_HEADERS}
+ ${obs-scripting-lua_SOURCES}
+ ${obs-scripting-lua_HEADERS}
+ ${SWIG_PY_RUNTIME}
+ ${SWIG_LUA_RUNTIME}
+ PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
+endif()
+
target_link_libraries(obs-scripting
libobs
${LUAJIT_LIBRARIES}
diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt
index 3d3733f..633d879 100644
--- a/libobs/CMakeLists.txt
+++ b/libobs/CMakeLists.txt
@@ -503,6 +503,11 @@ target_compile_options(libobs
PUBLIC
${ARCH_SIMD_FLAGS})
+if(UNIX)
+ set_source_files_properties(${libobs_SOURCES} PROPERTIES
+ COMPILE_FLAGS "-fvisibility=hidden")
+endif()
+
target_compile_options(libobs
PUBLIC
"${THREADS_DEFINITIONS}")
diff --git a/libobs/util/c99defs.h b/libobs/util/c99defs.h
index f84432a..1fb4821 100644
--- a/libobs/util/c99defs.h
+++ b/libobs/util/c99defs.h
@@ -34,7 +34,7 @@
#ifdef _MSC_VER
#define EXPORT __declspec(dllexport)
#else
-#define EXPORT
+#define EXPORT __attribute__((visibility("default")))
#endif
#include <stddef.h>