From 1a7ec841cb7b7ec57fbd5c478c137e0e8d10099d Mon Sep 17 00:00:00 2001 From: Steven Chamberlain Date: Tue, 12 Apr 2016 19:42:39 +0100 Subject: [PATCH] Export symbols of main executables for shared libs Set the ENABLE_EXPORTS property on the main executables, which adds linker flag -rdynamic if the compiler supports it. This ensures symbols are available for dynamic objects (such as shared libEntitiesMPD.so) to use. --- Sources/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 30e7290..80f518e 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -787,6 +787,8 @@ add_executable(ssam SeriousSam/MenuPrinting.cpp ) add_dependencies(ssam ParseEntities) +# Make symbols in the main executable available to dynamic objects +set_target_properties(ssam PROPERTIES ENABLE_EXPORTS ON) # !!! FIXME: this is an option because you have to recompile the entire engine twice. # !!! FIXME: If we can put the engine in a static library and not lose symbols, @@ -795,6 +797,8 @@ option(BUILD_DEDICATED_SERVER "Compile the dedicated server, too" FALSE) if(BUILD_DEDICATED_SERVER) add_executable(SeriousSamDedicated ${ENGINE_SRCS} DedicatedServer/DedicatedServer.cpp) add_dependencies(SeriousSamDedicated ParseEntities) + # Make symbols in the main executable available to dynamic objects + set_target_properties(SeriousSamDedicated PROPERTIES ENABLE_EXPORTS ON) endif() if(MACOSX)