Skip to content

Commit

Permalink
Unix: Compiler flags for symbol visibility
Browse files Browse the repository at this point in the history
All symbols must be hidden by default or otherwise the symbols from
gamekit extensions would clash.
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent d4009e1 commit b8805a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 4 additions & 0 deletions doomsday/cmake/PlatformUnix.cmake
Expand Up @@ -44,3 +44,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
append_unique (CMAKE_CXX_FLAGS_RELWITHDEBINFO -fno-tree-fre)
append_unique (CMAKE_CXX_FLAGS_MINSIZEREL -fno-tree-fre)
endif ()

# All symbols are hidden by default.
append_unique (CMAKE_C_FLAGS "-fvisibility=hidden")
append_unique (CMAKE_CXX_FLAGS "-fvisibility=hidden")
9 changes: 2 additions & 7 deletions doomsday/libs/core/include/de/libcore.h
Expand Up @@ -115,15 +115,10 @@
# endif
# define DE_NORETURN __declspec(noreturn)
#elif defined (MACOSX) || defined(__CYGWIN__)
//# ifdef __LIBCORE__
# define DE_PUBLIC __attribute__((visibility("default")))
//# else
//# define DE_PUBLIC
//# endif
# define DE_PUBLIC __attribute__((visibility("default")))
# define DE_NORETURN __attribute__((__noreturn__))
#else
// No need to use any special declarators.
# define DE_PUBLIC
# define DE_PUBLIC __attribute__((visibility("default")))
# define DE_NORETURN __attribute__((__noreturn__))
#endif

Expand Down

0 comments on commit b8805a5

Please sign in to comment.