Fix some build failures due to GL stuff.
[dcpomatic.git] / src / wx / wscript
index 580e49308cc46947d4acef6b23d17bf51c5b991f..f355189ef36b4ec680cf59eb591704bb828f1e77 100644 (file)
@@ -116,10 +116,12 @@ sources = """
           send_i18n_dialog.cc
           server_dialog.cc
           servers_list_dialog.cc
+          simple_video_view.cc
           standard_controls.cc
           static_text.cc
           subtitle_appearance_dialog.cc
           system_font_dialog.cc
+          system_information_dialog.cc
           table_dialog.cc
           templates_dialog.cc
           text_panel.cc
@@ -178,6 +180,9 @@ def configure(conf):
                            uselib_store='WXWIDGETS',
                            mandatory=True)
 
+    if conf.env.TARGET_LINUX:
+        conf.env.append_value('CXXFLAGS', ['-DGLX_GLXEXT_PROTOTYPES'])
+
     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.
@@ -252,6 +257,21 @@ def configure(conf):
         conf.env.STLIB_GL = 'gl'
         conf.env.STLIB_GLU = 'glu'
 
+    if conf.env.TARGET_LINUX:
+        conf.check_cxx(fragment="""
+                                #include <wx/glcanvas.h>
+                                #include <GL/glu.h>
+                                #include <GL/glext.h>
+                                #include <GL/glxext.h>
+                                int main() {
+                                    glXSwapIntervalEXT (0, 0, 1);
+                                    return 0;
+                                }
+                                """,
+                       msg='Checking for glXSwapIntervalEXT',
+                       okmsg='yes',
+                       uselib='GL WXWIDGETS',
+                       define_name='DCPOMATIC_HAVE_GLX_SWAP_INTERVAL_EXT')
 
 
 def build(bld):
@@ -262,7 +282,7 @@ def build(bld):
 
     obj.name   = 'libdcpomatic2-wx'
     obj.export_includes = ['..']
-    obj.uselib = 'BOOST_FILESYSTEM BOOST_THREAD BOOST_REGEX WXWIDGETS DCP SUB ZIP CXML RTAUDIO GL GLU '
+    obj.uselib = 'BOOST_FILESYSTEM BOOST_THREAD BOOST_REGEX WXWIDGETS DCP SUB ZIP CXML RTAUDIO '
     if bld.env.TARGET_LINUX:
         obj.uselib += 'GTK GL GLU '
     if bld.env.TARGET_WINDOWS: