#! /usr/bin/env python
# encoding: utf-8

# the following two variables are used by the target "waf dist"
VERSION='0.0.1'
APPNAME='io'

# these variables are mandatory ('/' are converted automatically)
top = '.'
out = 'build'

includes_dir = ['.', 'libs/', 'libs/include']
cxx_build_flags = ['-std=c++17', '-g', '-O0']
ld_flags = ['-lpthread']
link_flags = []


def options(opt):
    opt.load('clang++')

def configure(conf):
    conf.load('clang++')
    #conf.check(header_name='stdio.h', features='cxx cxxprogram', mandatory=False)

def build(bld):
    bld.program(
            source=bld.path.ant_glob(['src/**/*.cpp'], excl=['src/**/thread_pool.cpp', 'src/**/timer_wheel.cpp']), 
            #source=['src/main.cpp', 'src/thread_pool.cpp'], 
            #source=['src/main.cpp'], 
            includes = includes_dir,
            cxxflags = cxx_build_flags,
            linkflags = link_flags,
            ldflags = ld_flags,
            target='io'
            )

    if bld.cmd != 'clean':
        from waflib import Logs
        bld.logger = Logs.make_logger('test.log', 'build') # just to get a clean output

    bld.logger = None
