1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
# What I want to do is the following:
# I have my class files ending with .cc and
# the main file ending with .cpp. This way it
# very easy to do the following line just to
# have all sources in that variable
import os
mySrc = Glob("*.cc")
myFlags = ['-I.']
myEnv = Environment( ENV = os.environ, tools = ['default', \
'cxxtest'], toolpath=['../../'])
# Here is the first problem I corrected:
# Flags won't be correctly recognized by cxxtest
myEnv.Replace(CXXFLAGS = myFlags)
# Then I want to convert those sources to objects
myObjs = myEnv.Object(mySrc)
# Having the objects I can create my program
# this way:
myEnv.Program('hello', ['main.cpp'] + myObjs)
# Now I want to do the same thing with the tests
# target
# With the non corrected version you'll get 2 errors:
# The CXXFLAGS are not set correctly
# It won't even accept this construction, which as you see
# works perfectly with Program (and CxxTest should work like it)
myEnv.CxxTest('helloTest', ['hellotest.t.h'] + myObjs)
|