
import os

Help("""

  This is the third scons example. In this example we see more things that we
  can do with scons. Namely: arguments, variant build directory, and install.
  
  One can add the help for the expected build arguments using this help 
  function call
  
  DEBUG=1,0             - enable debug build, default 1
  ASSERT=1,0            - enable run time assertion, default 1 in DEBUG=1 and 0 otherwise
  COMPILER=compilerName - compiler name
  BUILDNAME=buildName   - build name

""")

#
# Processing arguments
#
debugArg = ARGUMENTS.get('DEBUG', '1')
if debugArg not in ['0', '1']:
  raise RuntimeError('Check the DEBUG input argument.')

assertArg = '1' if debugArg == '1' else ARGUMENTS.get('ASSERT', '0')
if assertArg not in ['0', '1']:
  raise RuntimeError('Check the ASSERT input argument.')

compilerName = ARGUMENTS.get('COMPILER', '')
buildName = ARGUMENTS.get('BUILDNAME', 'default')

#
# Initializing the environment
#
env = Environment(CC='clang',
                  CXX='clang')

if compilerName == 'gcc':
  env.Replace(CC='gcc')
  env.Replace(CXX='g++')

srcDir = Dir('#').abspath

buildDir = 


#
# Add build targets 
#
env.Program(target='helloworld',
            source=['main.cpp', 'foo.cpp'])
