ExtendedExampleSource1

garyo edited this page Dec 13, 2014 · 1 revision

Here's the current Sconstruct:

import SCons.Script
import os
def DoSrc(tgt, mode):
    build_dir = os.path.join('/projects', mode, tgt)
    SConscript('src/' + tgt + '/sconscript', build_dir= build_dir)

def DoFrozen(tgt, mode):
    build_dir = os.path.join('/projects', mode, tgt)
    SConscript('frozen/' + tgt + '/sconscript', build_dir= build_dir)

mode = 'release'
if ARGUMENTS.has_key('mode'):
   mode = ARGUMENTS['mode']
print '**** Compiling in ' + mode + ' mode...'

env = Environment()
Export('env')
env.PrependENVPath('PATH', 'E:/tools/mingw/bin')

DoSrc('pso', mode)
DoSrc('cppwiki', mode)
DoSrc('smanager', mode)
DoFrozen('jmirror', mode)

Note: the DoSrc and DoFrozen are identical except for the root directory. Should probably be refactored into one function

Here's a typical sconscript (they're all very similar):

import glob
Import('env')
project = 'cppwiki'

localenv = env.Copy()
localenv.Tool('msvc')
tgt = localenv.Program(project, glob.glob('*.cpp'))
env.Alias(project, tgt)
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.