Best way to construct a C++ compile list

buildship

(Joseph Fota) #1

Currently, I have some SCons build files which uses several Python lists to build various executable or static files

Example of lists and files:

util = Split('''util/fileD.cc util/fileE.cc util/fileF.cc''')
parse = Split('''parse/fileX.cc parse/fileY.cc parse/fileZ.cc''')
common = Split('''common/fileA.cc common/fileB.cc common/fileC.cc''')

Example of how the lists are used to eventual create an executable or static file

utils  = util + common
parser = parse + common

env.Program(target = 'utiltools', source = utils)
env.Program(target = 'parsertool', source = parse)

The results are *.o for each of the files, the *.o’s are then combined to make the executable or static file.

Is there some way to do this in Gradle?