Use PLATFORM_WINDOWS (in preference to WIN32) for consistency with the other libraries
[ardour.git] / libs / fst / wscript
index 4f4de4e2fffa7f803670ed36a9d6e854c23e3cbe..91273f3d793b7e02d8ad8947cde201aaa626f8e4 100644 (file)
@@ -27,6 +27,11 @@ def configure(conf):
     conf.load('misc')
     conf.load('compiler_cxx')
     autowaf.configure(conf)
+    if conf.env['WINDOWS_VST_SUPPORT'] == True and Options.options.dist_target == 'mingw':
+        conf.check(compiler='cxx',
+                   lib='gdi32',
+                   mandatory=True,
+                   uselib_store='GDI32')
 
 # Add a waf `feature' to allow compilation of things using winegcc
 from waflib.TaskGen import feature
@@ -44,9 +49,9 @@ def build(bld):
         # wine exec wrapper script
         obj = bld(features = 'subst', rule= 'chmod 0755 ${TGT}')
         obj.source = 'scanner.wine'
-        obj.target = 'ardour-' + bld.env['VERSION'] + '-vst-scanner'
+        obj.target = 'ardour-vst-scanner'
         obj.chmod  = Utils.O755
-        obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
+        obj.install_path = os.path.join(bld.env['LIBDIR'], 'fst')
         obj.dict   = {
             'VERSION' : bld.env['VERSION'],
                 }
@@ -54,15 +59,22 @@ def build(bld):
         obj = bld (features = 'c cxx cxxprogram wine')
         obj.source = (
             'scanner.cc',
-            'fst.c',
             'vstwin.c',
             )
-        obj.target = 'ardour-' + bld.env['VERSION'] + '-vst-scanner.exe.so'
         obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
+        obj.target = 'ardour-vst-scanner.exe.so'
+        obj.uselib = ['GIOMM', 'DL']
+        obj.use = [ 'libpbd' ]
     else:
         obj = bld (features = 'cxx c cxxprogram')
-        obj.source = ( 'scanner.cc' )
-        obj.target = 'ardour-' + bld.env['VERSION'] + '-vst-scanner'
+        if bld.is_defined('WINDOWS_VST_SUPPORT'):
+            obj.source = ( 'scanner.cc', 'vstwin.c' )
+            obj.uselib = ['GIOMM', 'DL', 'GDI32']
+        else:
+            obj.source = ( 'scanner.cc' )
+            obj.uselib = ['GIOMM', 'DL']
+        obj.target = 'ardour-vst-scanner'
+        obj.use = [ 'libpbd' ]
 
     obj.includes  = [ '../pbd/', '../ardour/', '.' ]
     obj.defines = [
@@ -71,5 +83,4 @@ def build(bld):
         'VST_SCANNER_APP',
         'PACKAGE="' + I18N_PACKAGE + '"',
         ]
-    obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
-    obj.uselib       = ['GIOMM', 'DL']
+    obj.install_path = os.path.join(bld.env['LIBDIR'], 'fst')