From e7a486fa81adac1833253c849ca73c5b3f7ef361 Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Tue, 28 Nov 2023 19:43:45 +0000 Subject: Hide unneeded internal symbols when building raylib as an so or dylib (#3573) --- src/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 3ccea903..772e5809 100644 --- a/src/Makefile +++ b/src/Makefile @@ -389,7 +389,13 @@ ifeq ($(RAYLIB_LIBTYPE),SHARED) # BE CAREFUL: It seems that for gcc -fpic is not the same as -fPIC # MinGW32 just doesn't need -fPIC, it shows warnings CFLAGS += -fPIC -DBUILD_LIBTYPE_SHARED + + # hide all symbols by default, so RLAPI can expose them + ifeq ($(PLATFORM_OS),$(filter $(PLATFORM_OS), LINUX BSD OSX)) + CFLAGS += -fvisibility=hidden + endif endif + ifeq ($(PLATFORM),PLATFORM_DRM) # without EGL_NO_X11 eglplatform.h tears Xlib.h in which tears X.h in # which contains a conflicting type Font -- cgit v1.2.3