1 import nil.directory, sys, os
4 boost = ARGUMENTS.get('boost')
5 boost_lib = ARGUMENTS.get('boost_lib')
6 ail = ARGUMENTS.get('ail')
7 ail_lib = ARGUMENTS.get('ail_lib')
8 python = ARGUMENTS.get('python')
10 dependencies = [boost, ail, boost_lib, ail_lib, python]
12 if len(filter(lambda x: x == None, dependencies)) > 0:
13 print 'This module requires boost (http://www.boost.org/), ail (http://repo.or.cz/w/ail.git) and Python 2.6 (32-bit version, http://www.python.org/) so you will have to specify the paths in the scons arguments:'
14 print 'scons boost=<boost header directory> boost_lib=<boost binary directory> ail=<ail header directory> ail_lib=<path to ail.lib> python=<path to your Python installation>'
17 python_library = os.path.join(python, 'libs', 'python26.lib')
18 python_include = os.path.join(python, 'include')
20 include_directories = [boost, ail, python_include]
23 '_CRT_SECURE_NO_WARNINGS': 1,
24 'BOOST_LIB_DIAGNOSTIC': 1
47 relative_source_directory = os.path.join('..', module)
49 source_files = map(lambda path: os.path.basename(path), nil.directory.get_files_by_extension(relative_source_directory, 'cpp'))
51 include_directories += [module]
53 cpus = int(os.environ.get('NUMBER_OF_PROCESSORS', 2))
55 thread_string = 'thread'
58 print 'Compiling project with %d %s' % (cpus, thread_string)
60 environment = Environment(CPPPATH = include_directories, CCFLAGS = flags, LIBPATH = boost_lib, LIBS = [ail_lib, python_library, 'user32.lib', 'kernel32.lib'], CPPDEFINES = defines)
61 environment.SetOption('num_jobs', cpus)
62 environment.SharedLibrary(module, source_files)