1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
#!/usr/bin/env python
import os
import sys
from tools.gpick import *
Import('*')
local_env = env.Clone()
if not local_env.GetOption('clean') and not env['TOOLCHAIN'] == 'msvc':
local_env.ParseConfig('pkg-config --cflags --libs $GTK_PC')
if env['USE_GTK3']:
local_env.ParseConfig('pkg-config --cflags --libs $CLUTTER_PC')
local_env.ParseConfig('pkg-config --cflags --libs $LUA_PC')
if local_env['ENABLE_NLS']:
local_env.Append(
CPPDEFINES = ['ENABLE_NLS'],
)
local_env.Append(
CPPDEFINES = ['GSEAL_ENABLE'],
)
sources = local_env.Glob('*.cpp') + local_env.Glob('transformation/*.cpp')
objects = []
objects.append(SConscript(['version/SConscript'], exports='env'))
objects.append(SConscript(['gtk/SConscript'], exports='env'))
objects.append(SConscript(['layout/SConscript'], exports='env'))
objects.append(SConscript(['internationalisation/SConscript'], exports='env'))
objects.append(SConscript(['dbus/SConscript'], exports='env'))
objects.append(SConscript(['tools/SConscript'], exports='env'))
if env['EXPERIMENTAL_CSS_PARSER']:
parser_objects, generated_files = SConscript(['cssparser/SConscript'], exports='env')
objects.append(parser_objects)
else:
generated_files = []
objects.append(SConscript(['color_names/SConscript'], exports='env'))
if env['TOOLCHAIN'] == 'msvc':
local_env.Append(LIBS = ['glib-2.0', 'gtk-win32-2.0', 'gobject-2.0', 'gdk-win32-2.0', 'cairo', 'gdk_pixbuf-2.0', 'lua5.2', 'expat2.1', 'pango-1.0', 'pangocairo-1.0', 'intl'])
else:
local_env.Append(LIBS = ['boost_filesystem', 'boost_system'])
if local_env['BUILD_TARGET'] == 'win32':
if not (env['TOOLCHAIN'] == 'msvc'):
local_env.Append(LINKFLAGS = '-mwindows')
local_env.Append(LIBS=['expat'])
else:
local_env.Append(LINKFLAGS = ['/SUBSYSTEM:WINDOWS', '/ENTRY:mainCRTStartup'], CPPDEFINES = ['XML_STATIC'])
objects.append(SConscript(['winres/SConscript'], exports='env'))
elif local_env['BUILD_TARGET'] == 'linux2':
local_env.Append(LIBS=['rt', 'expat'])
elif local_env['BUILD_TARGET'].startswith('gnu0'):
local_env.Append(LIBS=['rt', 'expat'])
elif local_env['BUILD_TARGET'].startswith('gnukfreebsd'):
local_env.Append(LIBS=['rt', 'expat'])
local_env.Append(CPPPATH=['#source'])
text_file_parser_objects = local_env.StaticObject(source = ['parser/TextFile.cpp', local_env.Ragel('parser/TextFileParser.rl')])
objects.append(text_file_parser_objects)
dynv_objects = local_env.StaticObject(source = local_env.Glob('dynv/*.cpp'))
objects.append(dynv_objects)
gpick_objects = local_env.StaticObject(source = sources)
gpick_object_map = {}
for obj in gpick_objects:
gpick_object_map[os.path.splitext(obj.name)[0]] = obj
objects.append(gpick_objects)
executable = local_env.Program('gpick', source = [objects])
test_env = local_env.Clone()
test_env.Append(LIBS = ['boost_unit_test_framework'])
test_dynv = test_env.Program('test_dynv', source = ['test/DynvTest.cpp', dynv_objects])
test_text_file = test_env.Program('test_text_file', source = ['test/TextFileTest.cpp', text_file_parser_objects, gpick_object_map['Color'], gpick_object_map['MathUtil']])
tests = [test_dynv, test_text_file]
Return('executable', 'tests', 'generated_files')
|