import os
import nucleotide


Import('settings')

name_full = 'test'
directory_pdb = './out'
directory_obj = './out'

settings.set_custom( 'RTL', 'dynamic' )
settings.set_custom( 'architecture', 'i386' )
settings.set_custom( 'configuration', 'debug' )

configuration = settings.get_custom( 'configuration' )

# Accumulate Atoms
settings.accumulate( 'include', { '0' : '../../src' } )
settings.accumulate( 'architecture', { 'name' : settings.get_custom( 'architecture' ) } )
settings.accumulate( 'exception' )
settings.accumulate( 'source:c++', { 'dialect' : 'c++11' } )
settings.accumulate( 'RTTI', { 'enable': 'false' } )
settings.accumulate( 'compiler:configuration', { 'name'          : configuration  } )
settings.accumulate( 'compiler:optimisation',  { 'configuration' : configuration  } )
settings.accumulate( 'PDB', { 'configuration': configuration , 'synchronous' : 'false', 'file-name': os.path.join( directory_pdb, name_full + '.pdb' ) } )
settings.accumulate( 'RTL', { 'configuration' : configuration, 'type': settings.get_custom( 'RTL' ) } )
#settings.accumulate( 'pp2f', { 'output' : 'asd.pp2f', 'extension' : 'pp2f',  )

# Accumulate source
envObject = nucleotide.Environment( settings ).native()



source = []
source +=   [
     envObject.StaticObject( target =  os.path.join( directory_obj, 'main'             ) + envObject[ 'OBJSUFFIX' ],  source = './main.cpp'       )
   , envObject.StaticObject( target =  os.path.join( directory_obj, 'conversion'       ) + envObject[ 'OBJSUFFIX' ],  source = './conversion.cpp' )
   , envObject.StaticObject( target =  os.path.join( directory_obj, 'targa'            ) + envObject[ 'OBJSUFFIX' ],  source = './targa.cpp'      )
   , envObject.StaticObject( target =  os.path.join( directory_obj, 'make'             ) + envObject[ 'OBJSUFFIX' ],  source = './make.cpp'       )
   , envObject.StaticObject( target =  os.path.join( directory_obj, 'bound'            ) + envObject[ 'OBJSUFFIX' ],  source = './bound.cpp'      )
   , envObject.StaticObject( target =  os.path.join( directory_obj, 'sizeof'           ) + envObject[ 'OBJSUFFIX' ],  source = './sizeof.cpp'     )
   , envObject.StaticObject( target =  os.path.join( directory_obj, 'selfie.cpp'       ) + envObject[ 'OBJSUFFIX' ],  source = './selfie.cpp'     )
   , envObject.StaticObject( target =  os.path.join( directory_obj, 'set.cpp'          ) + envObject[ 'OBJSUFFIX' ],  source = './set.cpp'        )
   , envObject.StaticObject( target =  os.path.join( directory_obj, './gray/main.cpp'  ) + envObject[ 'OBJSUFFIX' ],  source = './gray/main.cpp'  )
  ]

# Make native environment
envProgram = nucleotide.Environment( settings ).native()

# Create program
program = envProgram.Program( target =  './out/test' + envProgram['PROGSUFFIX'], source = source  )

# ... and return!
Return( 'program' )
