61 lines
1.6 KiB
Diff
61 lines
1.6 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 | 4 ++++
|
|
libobs/util/c99defs.h | 2 +-
|
|
3 files changed, 17 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/deps/obs-scripting/CMakeLists.txt b/deps/obs-scripting/CMakeLists.txt
|
|
index 92fb1b9..b324251 100644
|
|
--- a/deps/obs-scripting/CMakeLists.txt
|
|
+++ b/deps/obs-scripting/CMakeLists.txt
|
|
@@ -183,6 +183,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 8681148..49fffcd 100644
|
|
--- a/libobs/CMakeLists.txt
|
|
+++ b/libobs/CMakeLists.txt
|
|
@@ -478,6 +478,10 @@ elseif(NOT MSVC)
|
|
-msse2)
|
|
endif()
|
|
|
|
+if(UNIX)
|
|
+ set_source_files_properties(${libobs_SOURCES} PROPERTIES
|
|
+ COMPILE_FLAGS "-fvisibility=hidden")
|
|
+endif()
|
|
|
|
target_compile_options(libobs
|
|
PUBLIC
|
|
diff --git a/libobs/util/c99defs.h b/libobs/util/c99defs.h
|
|
index 6ea3534..6a99b13 100644
|
|
--- a/libobs/util/c99defs.h
|
|
+++ b/libobs/util/c99defs.h
|
|
@@ -46,7 +46,7 @@
|
|
|
|
#define EXPORT __declspec(dllexport)
|
|
#else
|
|
-#define EXPORT
|
|
+#define EXPORT __attribute__((visibility("default")))
|
|
#endif
|
|
|
|
#if _MSC_VER && _MSC_VER < 0x0708
|