#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import SCons
import shutil

Import('env', 'flags', 'platformString')


# On Posix default SCons.LIBPREFIX = 'lib', on Windows default SCons.LIBPREFIX = ''

wv_sources = [
	"soundsource.cpp", # required to subclass soundsource
	"soundsourcewv.cpp",  # Wavpack support
]


#Tell SCons to build the SoundSourceWV plugin
#=========================
if int(flags['wv']):
	SHLIBPREFIX='lib' #Makes the filename "libsoundsourcewv" consistently across platforms to make our lives easier.
	if 'win' in platformString:
		sswv_bin = env.SharedLibrary('soundsourcewv', wv_sources, LINKCOM  = [env['LINKCOM'], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;1'])
	else:
		sswv_bin = env.SharedLibrary('soundsourcewv', wv_sources)

	#Pass this soundsourcewv library object file back to the SConscript above us.
	Return("sswv_bin")
else:
	Return("")



