# This is an example of a simple SConstruct file for building
# programs against DOLFIN. To build this demo, just type 'scons'.

import os, glob, commands

# Get compiler from pkg-config
compiler = commands.getoutput('pkg-config --variable=compiler dolfin')

# Create a SCons Environment based on the main os environment
env = Environment(ENV=os.environ, CXX=compiler)

# Get compiler flags from pkg-config
env.ParseConfig('pkg-config --cflags --libs dolfin')

# Code generation is not this robust (yet)
env.ParseConfig('echo -Wno-unused-variable')

# Enable no optimization
env.ParseConfig('echo -g -O0')

# Program name
env.Program('demo', glob.glob("*.cpp") + glob.glob("generated_code/*.cpp"))
