From 30eaabb7ce70c333a66fc272cd7101b5814d1823 Mon Sep 17 00:00:00 2001 From: Koncord Date: Thu, 3 Jan 2019 04:20:03 +0800 Subject: [PATCH] [Server] Do not export all symbols --- apps/openmw-mp/CMakeLists.txt | 2 +- apps/openmw-mp/Script/Platform.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw-mp/CMakeLists.txt b/apps/openmw-mp/CMakeLists.txt index f7a6678af..3925c89e2 100644 --- a/apps/openmw-mp/CMakeLists.txt +++ b/apps/openmw-mp/CMakeLists.txt @@ -202,7 +202,7 @@ if (UNIX) target_link_libraries(tes3mp-server dl) # Fix for not visible pthreads functions for linker with glibc 2.15 if(NOT APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic") # TODO: use -Wl,--dynamic-list=list.txt instead + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--exclude-libs,ALL -rdynamic -fvisibility=hidden") target_link_libraries(tes3mp-server ${CMAKE_THREAD_LIBS_INIT}) endif(NOT APPLE) endif(UNIX) diff --git a/apps/openmw-mp/Script/Platform.hpp b/apps/openmw-mp/Script/Platform.hpp index 21087c775..13fc6222f 100644 --- a/apps/openmw-mp/Script/Platform.hpp +++ b/apps/openmw-mp/Script/Platform.hpp @@ -21,7 +21,7 @@ #define EXPORT_APIFUNCTION extern "C" __declspec(dllexport) #define CDECL __cdecl #else -#define EXPORT_APIFUNCTION extern "C" +#define EXPORT_APIFUNCTION extern "C" __attribute__ ((visibility ("default"))) #define CDECL #endif