#! /usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) def set_options(opt): # options defined if src/ was to be compiled as a standalone module opt.add_option('--meow', type='string', help='option hidden in the src module', dest='meow') def configure(conf): print ("sub-configuration file called (demo)") def build(bld): import Options print("command-line parameter meow is %r" % Options.options.meow) # 1. A simple c++ program bld( features = 'cxx cprogram', source = 'a1.cpp b1.cpp b2.cpp main.cpp', target = 'testprogram', defines = 'LINUX=1 BIDULE') # 2. A shared library, the extension (.so/.dll) is added automatically depending on the platform bld( features = 'cxx cshlib', source = 'a1.cpp b1.cpp b2.cpp', target = 'testshlib', install_path = '${SOME_INSTALL_DIR}') # 3. A static library bld( features = 'cxx cstaticlib', source = 'c1.cpp', name = 'unique1', target = 'teststaticlib') # 4. Another shared library bld( features = 'cxx cshlib', source = 'd1.cpp', target = 'shlib1', name = 'john', vnum = '1.2.3') # 5. A program that links against shlib1 bld( features = 'cxx cprogram', source = 'e1.cpp', uselib = 'MYPROG', uselib_local = 'unique1 john testshlib', # look for unique1 above target = 'program_dyn_linked') # IMPORTANT WARNING: # uselib_local expects *names*, that is, the field obj.name # by simplicity, when there is no ambiguity: obj.target == obj.name # for installing files, headers .. bld.install_files('${PREFIX}/include', 'a1.h') #install_as('${PREFIX}/dir/ahoy.h', 'a1.h')