import glob

Import('*')

env.Append(CPPPATH = ['#/src'])

# List subdirectories of 'fah/screensaver/' which contain source code here.
subdirs = ['']

# Source
src = []
for dir in subdirs:
    src += Glob('fah/screensaver/' + dir + '/*.cpp')

prog_src = ['FAHScreensaver.cpp']

# Resource files
if win32:
    prog_src.append(env.RES('fah/screensaver/resources/FAHScreensaver.rc'))

# Add local scrnsave lib
if int(env.get('cross_mingw')): prog_src.append('scrnsave.c')

# Build lib
lib = env.Library('fah-screensaver', src)
prog_src.append(lib)

# Main program
if win32: env.Replace(PROGSUFFIX = '.scr')
if int(env.get('cross_mingw', 0)): env.Append(LINKFLAGS = ['-mwindows'])
prog = env.Program('#/FAHScreensaver', prog_src)

pair = (prog, lib)
Return('pair')
