From 9433f9a282495f1916ee8d601015df1e1fc6cdc9 Mon Sep 17 00:00:00 2001 From: void Date: Fri, 13 Nov 2009 06:24:36 +0100 Subject: [PATCH] Replaced the SCons building system with a more primitive Python one --- SConscript | 84 -------------------------------------------------------------- SConstruct | 9 ------- build.py | 4 +++ 3 files changed, 4 insertions(+), 93 deletions(-) delete mode 100644 SConscript delete mode 100644 SConstruct create mode 100644 build.py diff --git a/SConscript b/SConscript deleted file mode 100644 index baf4af8..0000000 --- a/SConscript +++ /dev/null @@ -1,84 +0,0 @@ -import nil.directory, nil.environment, sys, os - -library = 'ail' -source = 'source' - -is_windows = nil.environment.is_windows() - -if is_windows: - boost = ARGUMENTS.get('boost') - bzip2 = ARGUMENTS.get('bzip2') - zlib = ARGUMENTS.get('zlib') - - if boost == None: - - print 'This library requires boost (www.boost.org) so you will have to specify the path to the boost library in the scons arguments:' - print 'scons boost=' - print 'The bzip2 (www.bzip.org) and the zlib (www.zlib.net) components of this library are optional and will require you to specify their locations the same way:' - print 'scons boost= bzip2= zlib=' - sys.exit(1) - - optional_files = [ - (bzip2, 'bzip2.cpp'), - (zlib, 'zlib.cpp') - ] - - defines = { - '_WIN32_WINNT': '0x0501', - '_CRT_SECURE_NO_WARNINGS': '1', - '_SCL_SECURE_NO_WARNINGS': '1', - 'BOOST_LIB_DIAGNOSTIC': 1 - } - - flags = [ - '/EHsc' - ] - - linker_flags = [ - '/NOLOGO', - '/LTCG' - ] - - dependencies = [boost, bzip2, zlib] - -else: - optional_files = [] - defines = {} - flags = [] - linker_flags = [] - dependencies = [] - -relative_source = os.path.join('..', source) - -source_files = nil.directory.get_files_by_extension(relative_source, 'cpp') -map_path = lambda path: os.path.basename(path) -source_files = map(map_path, source_files) -if len(source_files) == 0: - print 'No targets. CWD: %s' % os.getcwd() - sys.exit(1) - -print '%d targets:' % len(source_files) - -for source_file in source_files: - print source_file - -for path, file in optional_files: - if path == None: - source_files.remove(file) - pass - -include_directories = ['..'] + filter(lambda path: path != None, dependencies) - -cpus = int(os.environ.get('NUMBER_OF_PROCESSORS', 1)) - -thread_string = 'thread' -if cpus > 1: - thread_string += 's' -print 'Compiling project with %d %s' % (cpus, thread_string) - -source_files = map(lambda path: os.path.join('..', source, path), source_files) - -environment = Environment(CPPPATH = include_directories, CPPDEFINES = defines, CCFLAGS = flags) -environment.Append(LINKFLAGS = linker_flags) -environment.SetOption('num_jobs', cpus) -environment.StaticLibrary(library, source_files) diff --git a/SConstruct b/SConstruct deleted file mode 100644 index 25be00a..0000000 --- a/SConstruct +++ /dev/null @@ -1,9 +0,0 @@ -import os, shutil - -source = 'ail' -script = 'SConscript' -temporary = os.path.join(source, script) - -shutil.copyfile(script, temporary) -SConscript(temporary, variant_dir = 'build', duplicate = 0) -os.unlink(temporary) \ No newline at end of file diff --git a/build.py b/build.py new file mode 100644 index 0000000..7e38661 --- /dev/null +++ b/build.py @@ -0,0 +1,4 @@ +import nil.build + +builder = nil.build.builder('ail') +builder.static_library() -- 2.11.4.GIT