Try to fix GL link on OS X.
[dcpomatic.git] / src / wx / wscript
index 7b3882c39f7ef29b85eb4e3d5781026ba3e6b92e..67f19e67a9f288022ad0ffe6686e78e222c203ef 100644 (file)
@@ -178,8 +178,6 @@ def configure(conf):
                            uselib_store='WXWIDGETS',
                            mandatory=True)
 
-    conf.env.LIB_WXWIDGETS.append('GLU')
-
     if conf.options.static_wxwidgets:
        # wx-config returns its static libraries as full paths, without -l prefixes, which confuses
         # check_cfg().  It puts the static libraries into LINKFLAGS_WXWIDGETS, so fish them out.
@@ -247,6 +245,12 @@ def configure(conf):
                    define_name='DCPOMATIC_USE_RTERROR',
                    mandatory=False)
 
+    if conf.env.TARGET_WINDOWS or conf.env.TARGET_LINUX:
+        conf.check_cfg(package='gl', args='--cflags --libs', uselib_store='GL', mandatory=True)
+        conf.check_cfg(package='glu', args='--cflags --libs', uselib_store='GLU', mandatory=True)
+    else:
+        conf.env.STLIB_GL = 'gl'
+        conf.env.STLIB_GLU = 'glu
 
 
 def build(bld):
@@ -257,13 +261,13 @@ def build(bld):
 
     obj.name   = 'libdcpomatic2-wx'
     obj.export_includes = ['..']
-    obj.uselib = 'BOOST_FILESYSTEM BOOST_THREAD BOOST_REGEX WXWIDGETS DCP SUB ZIP CXML RTAUDIO '
+    obj.uselib = 'BOOST_FILESYSTEM BOOST_THREAD BOOST_REGEX WXWIDGETS DCP SUB ZIP CXML RTAUDIO GL GLU '
     if bld.env.TARGET_LINUX:
         obj.uselib += 'GTK '
     if bld.env.TARGET_WINDOWS:
         obj.uselib += 'WINSOCK2 OLE32 DSOUND WINMM KSUSER '
     if bld.env.TARGET_OSX:
-        obj.framework = ['CoreAudio']
+        obj.framework = ['CoreAudio', 'OpenGL']
     obj.use = 'libdcpomatic2'
     if bld.env.VARIANT == 'swaroop':
         obj.source = sources + " swaroop_controls.cc"