We must only link gtk2 if wx is also using it.
[dcpomatic.git] / src / wx / wscript
index c6e8362ddf802b1fbc711ae5746587f9115192e2..339ebb1ec8f0dab45fe26646c3ea2660917a4754 100644 (file)
@@ -201,7 +201,7 @@ def configure(conf):
         conf.env.append_value('CXXFLAGS', ['-DWGL_WGLEXT_PROTOTYPES'])
 
     if conf.options.static_wxwidgets:
-       # wx-config returns its static libraries as full paths, without -l prefixes, which confuses
+        # 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.
         stlibs = []
         new_linkflags = []
@@ -225,6 +225,10 @@ def configure(conf):
     if not wx_version.startswith('3.0.'):
         conf.fatal('wxwidgets version 3.0.x is required; %s found' % wx_version)
 
+    config = conf.check_cfg(package='wxwidgets', path=wx_config, args='--selected-config').strip()
+    if config.find('gtk2') != -1:
+        conf.check_cfg(package='gtk+-2.0', args='--cflags --libs', uselib_store='GTK', mandatory=True)
+
     try:
         conf.check_cfg(msg='Checking for RtAudio using pkg-config',
                        package='rtaudio',