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

from waflib import Task, Options, Logs
from waflib.TaskGen import extension
import shutil, os

#import sys, ctypes
#from waflib import TaskGen

def options(opt):
    pass

def build(bld):

    src = [
        './NeuralAmpModelerCore/NAM/activations.cpp',
        './NeuralAmpModelerCore/NAM/convnet.cpp',
        './NeuralAmpModelerCore/NAM/dsp.cpp',
        './NeuralAmpModelerCore/NAM/get_dsp.cpp',
        './NeuralAmpModelerCore/NAM/lstm.cpp',
        './NeuralAmpModelerCore/NAM/util.cpp',
        './NeuralAmpModelerCore/NAM/wavenet.cpp',
        ]

    incl = ['../headers', '..',
        './NeuralAmpModelerCore/NAM/',
        './NeuralAmpModelerCore/Dependencies/eigen/',
        './NeuralAmpModelerCore/Dependencies/nlohmann/',
        ]

    cxx_flags = ["-std=c++17", "-Wno-sign-compare", "-Ofast"]

    if not bld.env['LTO']:
        cxx_flags.append ("-fno-fat-lto-objects")

    bld.stlib(
        name = 'libnam',
        includes = incl,
        export_includes=['..'],
        source = src,
        use = [],
        cxxflags = cxx_flags,
        target = 'nam',
        )
