Please note:The SCons wiki is in read-only mode due to ongoing spam/DoS issues. Also, new account creation is currently disabled. We are looking into alternative wiki hosts.
Differences between revisions 8 and 9
Revision 8 as of 2007-03-16 21:15:42
Size: 1318
Editor: 63
Comment:
Revision 9 as of 2008-03-12 02:47:02
Size: 1318
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

I have 3 groups of files, all reside in the same directory:

  • group1: file1.cc file2.cc file3.cc 
    group2: file4.cc file5.cc file6.cc 
    group3: file7.cc 

and then I have main.cc

I want to compile

  • group1 with "-g"
  • group 2 same as group 1 and in addition with "-Wall"
  • group3 same as group 2 and in addition with " -fprofile-arcs -ftest-coverage "

My Sconstruct looks like this:

flags = '-g'
fsharp = flags + ' -Wall'
fprof  = fsharp + ' -fprofile-arcs -ftest-coverage'
.
base = Environment(CCFLAGS = flags)
sharp = base.Clone(CCFLAGS = fsharp)
prof  = sharp.Clone(CCFLAGS = fprof)
.
prfList = Split("""
            file7.cc
""")
.
myList = Split("""
            file4.cc
            file5.cc
            file6.cc
""")
.
list = Split("""
            file1.cc
            file2.cc
            file3.cc
""")
.
prof.Library('my1', prfList)
sharp.Library('my2', myList)
base.Library('my3', list)
.
#Library('my',['my1','my2','my3'])
# this does NOT work ...???
.
sharp.Program('main.cc', LIBS=['my1','my2','my3','my1','my2','my3'], LIBPATH='.') 

Because I can't build a library from libraries, I have to specify my sublibraries twice, since there are dependencies between them. Does anybody know a better way to achieve this ...???

SimpleProject_1 (last edited 2008-03-12 02:47:02 by localhost)