Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 42620103d8ee8a2d972d3103bad0ab73 > files > 315

waf-1.5.19-1.fc14.noarch.rpm

#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2009 (ita)

VERSION='0.0.1'
APPNAME='groups'

top = '.'
out = 'build'

import Options

def set_options(opt):
	opt.tool_options('compiler_cxx')
	opt.add_option('--usegroup', action='store_true', default=False, help='Show the effect of using add_group')

def hey(bld):
	print "@ before the build"

def ho(bld):
	print "@ after the build"

def configure(conf):
	conf.check_tool('compiler_cxx')

	conf.env.append_value('CXXFLAGS', ['-O2'])

	debugEnv = conf.env.copy()
	debugEnv.set_variant('debug')
	conf.set_env_name('debug', debugEnv)

	conf.setenv('debug')
	conf.env.append_value('CXXFLAGS', ['-O0', '-g3'])

def build(bld):

	obj1 = bld(features='cxx cprogram', source='main.cpp', target='group')

	# IMPORTANT: compare the execution of
	# waf clean build --usegroup
	# waf clean build
	if Options.options.usegroup:
		bld.add_group('test')

	# groups may be used to represent global dependencies which may be very difficult to represent:
	# * building a compiler before using it
	# * executing the tests after the build is complete
	# * ...

	obj2 = obj1.clone('debug')