summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2017-07-17 14:16:23 +0200
committerRay <[email protected]>2017-07-17 14:16:23 +0200
commit8f569e59b177e879fe350027a706c6f731f86c4a (patch)
treec6cec9fabd6e1b0dd624510ab22b41dc1ef7205f
parentbf169f7f42384e79bff2c5c797532685a147b6b6 (diff)
downloadraylib-8f569e59b177e879fe350027a706c6f731f86c4a.tar.gz
raylib-8f569e59b177e879fe350027a706c6f731f86c4a.zip
Review shared library generation
-rw-r--r--src/Makefile16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Makefile b/src/Makefile
index 6579d424..35949d89 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -215,7 +215,6 @@ endif
ifeq ($(SHARED_RAYLIB),YES)
CFLAGS += -fPIC
SHAREDFLAG = BUILDING_DLL
- SHAREDLIBS = -Lexternal/glfw3/lib/win32 -Lexternal/openal_soft/lib/win32 -lglfw3 -lgdi32
else
SHAREDFLAG = BUILDING_STATIC
endif
@@ -317,15 +316,20 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
@echo "libraylib.bc generated (web version)!"
else
ifeq ($(SHARED_RAYLIB),YES)
+ # NOTE: If using OpenAL Soft as static library, all its dependencies must be also linked in the shared library
+ ifeq ($(PLATFORM_OS),WINDOWS)
+ $(CC) -shared -o $(OUTPUT_PATH)/raylib.dll $(OBJS) $(SHAREDLIBS) -Lexternal/glfw3/lib/win32 -Lexternal/openal_soft/lib/win32 -lglfw3 -lgdi32 -Wl,--out-implib,$(OUTPUT_PATH)/libraylibdll.a
+ @echo "raylib dynamic library (raylib.dll) and import library (libraylibdll.a) generated!"
+ endif
ifeq ($(PLATFORM_OS),LINUX)
# compile raylib to shared library version for GNU/Linux.
# WARNING: you should type "make clean" before doing this target
- $(CC) -shared -o $(OUTPUT_PATH)/libraylib.so $(OBJS)
- @echo "raylib shared library (libraylib.so) generated!"
+ $(CC) -shared -o $(OUTPUT_PATH)/libraylib.so $(OBJS) -lglfw3 -lGL -lopenal -lm -lpthread -ldl
+ @echo "raylib shared library generated (libraylib.so)!"
endif
- ifeq ($(PLATFORM_OS),WINDOWS)
- $(CC) -shared -o $(OUTPUT_PATH)/raylib.dll $(OBJS) $(SHAREDLIBS) -Wl,--out-implib,$(OUTPUT_PATH)/libraylibdll.a
- @echo "raylib dynamic library (raylib.dll) and import library (libraylibdll.a) generated!"
+ ifeq ($(PLATFORM_OS),OSX)
+ $(CC) -shared -o $(OUTPUT_PATH)/libraylib.so $(OBJS) -lglfw -framework OpenGL -framework OpenAL -framework Cocoa
+ @echo "raylib shared library generated (libraylib.so)!"
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
$(CC) -shared -o $(OUTPUT_PATH)/libraylib.so $(OBJS)