1 import nil.directory, sys, os
\r
4 boost = ARGUMENTS.get('boost')
\r
5 boost_lib = ARGUMENTS.get('boost_lib')
\r
6 ail = ARGUMENTS.get('ail')
\r
7 ail_lib = ARGUMENTS.get('ail_lib')
\r
8 python = ARGUMENTS.get('python')
\r
10 dependencies = [boost, ail, boost_lib, ail_lib, python]
\r
12 if len(filter(lambda x: x == None, dependencies)) > 0:
\r
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:'
\r
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>'
\r
17 python_library = os.path.join(python, 'libs', 'python26.lib')
\r
18 python_include = os.path.join(python, 'include')
\r
20 include_directories = [boost, ail, python_include]
\r
23 '_CRT_SECURE_NO_WARNINGS': 1,
\r
24 'BOOST_LIB_DIAGNOSTIC': 1
\r
47 relative_source_directory = os.path.join('..', module)
\r
49 source_files = map(lambda path: os.path.basename(path), nil.directory.get_files_by_extension(relative_source_directory, 'cpp'))
\r
51 include_directories += [module]
\r
53 cpus = int(os.environ.get('NUMBER_OF_PROCESSORS', 2))
\r
55 thread_string = 'thread'
\r
57 thread_string += 's'
\r
58 print 'Compiling project with %d %s' % (cpus, thread_string)
\r
60 environment = Environment(CPPPATH = include_directories, CCFLAGS = flags, LIBPATH = boost_lib, LIBS = [ail_lib, python_library, 'user32.lib', 'kernel32.lib'], CPPDEFINES = defines)
\r
61 environment.SetOption('num_jobs', cpus)
\r
62 environment.SharedLibrary(module, source_files)