gl/meson: fix macos additions for non-macos platforms

"gst-libs/gst/gl/meson.build:655:20: ERROR:  Unknown variable "quartzcore_dep"."
This commit is contained in:
Matthew Waters 2018-08-03 19:06:00 +10:00
parent 06b8792a5f
commit 3d22e7d9da

View File

@ -624,6 +624,17 @@ if need_platform_wgl != 'no' and need_win_win32 != 'no'
endif endif
endif endif
# OSX check
if need_platform_cgl == 'yes'
if need_win_cocoa == 'no'
error('Impossible situation requested: Cannot use CGL without Cocoa support')
elif need_api_opengl == 'no'
error('Impossible situation requested: Cannot use CGL without the OpenGL library')
endif
elif need_platform_cgl == 'no' and need_win_cocoa == 'yes'
error('Impossible situation requested: Cannot use Cocoa without CGL support')
endif
if host_machine.system() == 'darwin' if host_machine.system() == 'darwin'
if not have_objc if not have_objc
error('No ObjC compiler found') error('No ObjC compiler found')
@ -638,43 +649,32 @@ if host_machine.system() == 'darwin'
quartzcore_dep = dependency('QuartzCore', required : false) quartzcore_dep = dependency('QuartzCore', required : false)
corefoundation_dep = dependency('CoreFoundation', required : false) corefoundation_dep = dependency('CoreFoundation', required : false)
endif
# OSX check if need_platform_cgl != 'no'
if need_platform_cgl == 'yes' if quartzcore_dep.found() and corefoundation_dep.found()
if need_win_cocoa == 'no' gl_platform_deps += [quartzcore_dep, corefoundation_dep]
error('Impossible situation requested: Cannot use CGL without Cocoa support') enabled_gl_platforms += 'cgl'
elif need_api_opengl == 'no' glconf.set10('GST_GL_HAVE_PLATFORM_CGL', 1)
error('Impossible situation requested: Cannot use CGL without the OpenGL library')
endif
elif need_platform_cgl == 'no' and need_win_cocoa == 'yes'
error('Impossible situation requested: Cannot use Cocoa without CGL support')
endif
if need_platform_cgl != 'no' if need_win_cocoa != 'no'
if quartzcore_dep.found() and corefoundation_dep.found() cocoa_dep = dependency('Cocoa', required : false)
gl_platform_deps += [quartzcore_dep, corefoundation_dep] if cocoa_dep.found()
enabled_gl_platforms += 'cgl' gl_sources += [
glconf.set10('GST_GL_HAVE_PLATFORM_CGL', 1) 'cocoa/gstglcaopengllayer.m',
'cocoa/gstglcontext_cocoa.m',
if need_win_cocoa != 'no' 'cocoa/gstgldisplay_cocoa.m',
cocoa_dep = dependency('Cocoa', required : false) 'cocoa/gstglwindow_cocoa.m'
if cocoa_dep.found() ]
gl_sources += [ gl_winsys_deps += cocoa_dep
'cocoa/gstglcaopengllayer.m', enabled_gl_winsys += 'cocoa'
'cocoa/gstglcontext_cocoa.m', glconf.set10('GST_GL_HAVE_WINDOW_COCOA', 1)
'cocoa/gstgldisplay_cocoa.m', elif need_win_cocoa == 'yes'
'cocoa/gstglwindow_cocoa.m' error('Could not find Cocoa')
] endif
gl_winsys_deps += cocoa_dep
enabled_gl_winsys += 'cocoa'
glconf.set10('GST_GL_HAVE_WINDOW_COCOA', 1)
elif need_win_cocoa == 'yes'
error('Could not find Cocoa')
endif endif
elif need_platform_cgl == 'yes'
error('Could not find CGL dependencies')
endif endif
elif need_platform_cgl == 'yes'
error('Could not find CGL dependencies')
endif endif
endif endif