[vlc-devel] [PATCH] opengl: put the common source files in a locally built static library

Steve Lhomme robux4 at videolabs.io
Sat Nov 11 17:45:49 CET 2017


---
replaces https://patches.videolan.org/patch/18606/
- only compile the extra module if OpenGL is enabled
---
 modules/video_output/Makefile.am | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am
index ee7e150abd..914c4b01ce 100644
--- a/modules/video_output/Makefile.am
+++ b/modules/video_output/Makefile.am
@@ -7,6 +7,10 @@ OPENGL_COMMONSOURCES = video_output/opengl/vout_helper.c \
 	video_output/opengl/vout_helper.h video_output/opengl/converter.h \
 	video_output/opengl/internal.h video_output/opengl/fragment_shaders.c \
 	video_output/opengl/converter_sw.c
+if HAVE_GL
+vlc_vout_opengl_la_SOURCES = $(OPENGL_COMMONSOURCES)
+noinst_LTLIBRARIES += vlc_vout_opengl.la
+endif
 
 OPENGL_COMMONCLFAGS = $(LIBPLACEBO_CFLAGS)
 OPENGL_COMMONLIBS = $(LIBPLACEBO_LIBS)
@@ -23,15 +27,15 @@ libglconv_cvpx_plugin_la_SOURCES = video_output/opengl/converter_cvpx.c \
 libglconv_cvpx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
 
 if HAVE_OSX
-libvout_macosx_plugin_la_SOURCES = video_output/macosx.m $(OPENGL_COMMONSOURCES)
+libvout_macosx_plugin_la_SOURCES = video_output/macosx.m
 libvout_macosx_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS)
-libvout_macosx_plugin_la_LIBADD = $(OPENGL_COMMONLIBS)
+libvout_macosx_plugin_la_LIBADD = $(OPENGL_COMMONLIBS) vlc_vout_opengl.la
 libvout_macosx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \
 	-Wl,-framework,OpenGL,-framework,Cocoa
 
-libcaopengllayer_plugin_la_SOURCES = video_output/caopengllayer.m $(OPENGL_COMMONSOURCES)
+libcaopengllayer_plugin_la_SOURCES = video_output/caopengllayer.m
 libcaopengllayer_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS)
-libcaopengllayer_plugin_la_LIBADD = $(OPENGL_COMMONLIBS)
+libcaopengllayer_plugin_la_LIBADD = $(OPENGL_COMMONLIBS) vlc_vout_opengl.la
 libcaopengllayer_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \
 	-Wl,-framework,OpenGL,-framework,Cocoa,-framework,QuartzCore
 
@@ -45,9 +49,9 @@ if HAVE_IOS
 libglconv_cvpx_plugin_la_CFLAGS = $(AM_CFLAGS) -DUSE_OPENGL_ES2
 endif
 
-libvout_ios_plugin_la_SOURCES = video_output/ios.m $(OPENGL_COMMONSOURCES)
+libvout_ios_plugin_la_SOURCES = video_output/ios.m
 libvout_ios_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS)
-libvout_ios_plugin_la_LIBADD = $(OPENGL_COMMONLIBS)
+libvout_ios_plugin_la_LIBADD = $(OPENGL_COMMONLIBS) vlc_vout_opengl.la
 libvout_ios_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \
 	-Wl,-framework,OpenGLES,-framework,QuartzCore,-framework,UIKit
 if HAVE_IOS
@@ -58,17 +62,17 @@ vout_LTLIBRARIES += libvout_ios_plugin.la
 endif
 
 ### OpenGL ###
-libgles2_plugin_la_SOURCES = $(OPENGL_COMMONSOURCES) video_output/opengl/display.c
+libgles2_plugin_la_SOURCES = video_output/opengl/display.c
 libgles2_plugin_la_CFLAGS = $(AM_CFLAGS) $(GLES2_CFLAGS) -DUSE_OPENGL_ES2 $(OPENGL_COMMONCLFAGS)
-libgles2_plugin_la_LIBADD = $(GLES2_LIBS) $(LIBM) $(OPENGL_COMMONLIBS)
+libgles2_plugin_la_LIBADD = $(GLES2_LIBS) $(LIBM) $(OPENGL_COMMONLIBS) vlc_vout_opengl.la
 libgles2_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
 
 EXTRA_LTLIBRARIES += libgles2_plugin.la
 vout_LTLIBRARIES += $(LTLIBgles2)
 
-libgl_plugin_la_SOURCES = $(OPENGL_COMMONSOURCES) video_output/opengl/display.c
+libgl_plugin_la_SOURCES = video_output/opengl/display.c
 libgl_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS) $(OPENGL_COMMONCLFAGS)
-libgl_plugin_la_LIBADD = $(GL_LIBS) $(LIBM) $(OPENGL_COMMONLIBS)
+libgl_plugin_la_LIBADD = $(GL_LIBS) $(LIBM) $(OPENGL_COMMONLIBS) vlc_vout_opengl.la
 
 libglconv_vaapi_wl_plugin_la_SOURCES = video_output/opengl/converter_vaapi.c \
 	video_output/opengl/converter.h \
-- 
2.14.2



More information about the vlc-devel mailing list