SCons C++ Specifying Various Build Options


Example

This example shows more detailed build settings:

env=Environment(
    CPPPATH='/usr/include/boost/',
    CPPDEFINES=['foo'],
    LIBS=['bar'],
    SCONS_CXX_STANDARD='c++11')

env.Program('hello', Glob('src/*.cpp'))

This builds the executable hello from all the cpp files in src, with the following settings:

  • The search path is `/usr/include/boost'

  • The constant FOO is defined

  • The executable links with bar

  • C++11 is used as a standard