You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
6.9 KiB
Python

# -*- mode: python -*-
# idx map:
# 10xx scraps
# 100xx zlib
# 101xx tinyxml
# 102xx mujs
# 5xxxx libshit
APPNAME='scraps'
LIBSHIT_CROSS=False
def options(opt):
grp = opt.get_option_group('configure options')
opt.recurse('libshit', name='options')
opt.recurse('ext', name='options')
def configure(cfg):
cfg.recurse('libshit', name='configure', once=False)
cfg.recurse('ext', name='configure', once=False)
if cfg.env.DEST_OS != 'win32':
cfg.check_cxx(lib='pthread')
def build(ctx):
ctx.recurse('libshit', once=False)
ctx.recurse('ext', name='build', once=False)
ctx.gen_version_hpp('src/scraps/version.hpp')
if ctx.env.WITH_TESTS:
src = [
'src/scraps/format/rags_sql/test_helper/memory_db.cpp',
'src/scraps/format/rags_sql/test_helper/memory_sql.cpp',
'src/scraps/format/rags_sql/test_helper/sql_helper.cpp',
'src/scraps/format/rags_sql/test_helper/sql_server.cpp',
'test/scraps/bitfield.cpp',
'test/scraps/game/id_set.cpp',
'test/scraps/game/state_container.cpp',
]
ctx.objects(idx = 1002,
source = src,
includes = 'src test',
uselib = 'SCRAPS',
use = 'PTHREAD libshit',
target = 'scraps-tests')
ctx.objects(idx = 1003,
source = [ 'src/scraps/format/rags_sql/gzip.cpp' ],
includes = 'src',
uselib = 'SCRAPS',
use = 'ZLIB zlib libshit',
target = 'scraps-gzip')
src = [
'src/scraps/format/rags_sql/sql_importer.cpp',
'src/scraps/format/rags_sql/sql_importer_action.cpp',
'src/scraps/format/rags_sql/sql_importer_character.cpp',
'src/scraps/format/rags_sql/sql_importer_file.cpp',
'src/scraps/format/rags_sql/sql_importer_helpers.cpp',
'src/scraps/format/rags_sql/sql_importer_misc.cpp',
'src/scraps/format/rags_sql/sql_importer_object.cpp',
'src/scraps/format/rags_sql/sql_importer_room.cpp',
'src/scraps/format/rags_sql/sql_importer_timer.cpp',
'src/scraps/format/rags_sql/sql_importer_variable.cpp',
]
ctx.objects(idx = 1004,
source = src,
includes = 'src',
uselib = 'SCRAPS',
use = 'CAPNP TINYXML capnp libshit tinyxml',
target = 'scraps-xml')
src = [
'src/scraps/game/action_eval/command_misc.cpp',
'src/scraps/game/action_eval/command_variable.cpp',
'src/scraps/js.cpp',
]
ctx.objects(idx = 1005,
source = src,
includes = 'src',
uselib = 'SCRAPS',
use = 'CAPNP MUJS capnp libshit mujs',
target = 'scraps-js')
src = [
'src/scraps/date_time.cpp',
'src/scraps/dotnet_date_time_format.cpp',
'src/scraps/dotnet_date_time_parse.cpp',
'src/scraps/format/archive.cpp',
'src/scraps/format/proto/action.capnp',
'src/scraps/format/proto/game.capnp',
'src/scraps/format/rags_common/importer_action.cpp',
'src/scraps/format/rags_common/importer_base.cpp',
'src/scraps/format/rags_common/importer_file.cpp',
'src/scraps/format/rags_common/importer_object.cpp',
'src/scraps/format/rags_common/importer_variable.cpp',
'src/scraps/format/rags_sql/base64.cpp',
'src/scraps/format/rags_sql/default_schema.cpp',
'src/scraps/format/rags_sql/popen_sql.cpp',
'src/scraps/format/rags_sql/schema_update.cpp',
'src/scraps/format/rags_sql/sql.cpp',
'src/scraps/format/string_pool.cpp',
'src/scraps/game/action_eval.cpp',
'src/scraps/game/action_eval/action_helper.cpp',
'src/scraps/game/action_eval/choices.cpp',
'src/scraps/game/action_eval/command_action.cpp',
'src/scraps/game/action_eval/command_character.cpp',
'src/scraps/game/action_eval/command_file.cpp',
'src/scraps/game/action_eval/command_helper.cpp',
'src/scraps/game/action_eval/command_list.cpp',
'src/scraps/game/action_eval/command_object.cpp',
'src/scraps/game/action_eval/command_objects.cpp',
'src/scraps/game/action_eval/command_room.cpp',
'src/scraps/game/action_eval/command_timer.cpp',
'src/scraps/game/action_eval/condition.cpp',
'src/scraps/game/action_eval/enter_leave.cpp',
'src/scraps/game/action_eval/game_init.cpp',
'src/scraps/game/action_eval/if_character.cpp',
'src/scraps/game/action_eval/if_helper.cpp',
'src/scraps/game/action_eval/if_misc.cpp',
'src/scraps/game/action_eval/if_object.cpp',
'src/scraps/game/action_eval/if_variable.cpp',
'src/scraps/game/action_eval/loop_misc.cpp',
'src/scraps/game/action_eval/loop_object.cpp',
'src/scraps/game/action_eval/outer_action.cpp',
'src/scraps/game/action_eval/timer.cpp',
'src/scraps/game/action_state.cpp',
'src/scraps/game/character_state.cpp',
'src/scraps/game/dummy_game.cpp',
'src/scraps/game/game_controller.cpp',
'src/scraps/game/game_state.cpp',
'src/scraps/game/object_state.cpp',
'src/scraps/game/property_state.cpp',
'src/scraps/game/room_state.cpp',
'src/scraps/game/text_replace.cpp',
'src/scraps/game/text_replace/attribute.cpp',
'src/scraps/game/text_replace/js_array.cpp',
'src/scraps/game/text_replace/property.cpp',
'src/scraps/game/text_replace/simple_misc.cpp',
'src/scraps/game/text_replace/simple_object.cpp',
'src/scraps/game/text_replace/simple_player.cpp',
'src/scraps/game/text_replace/simple_room.cpp',
'src/scraps/game/text_replace/variable.cpp',
'src/scraps/game/timer_state.cpp',
'src/scraps/game/variable_state.cpp',
'src/scraps/polymorphic_stack.cpp',
'src/scraps/popen.cpp',
'src/scraps/string_utils.cpp',
'src/scraps/ui/dummy.cpp',
'src/scraps/uuid.cpp',
]
# compile common stuff that doesn't depend on optionals as a separate
# objects task. this way enabling/disabling optionals doesn't rebuild the
# whole code due to include path changes
ctx.objects(idx = 1000,
source = src,
includes = 'src',
uselib = 'SCRAPS',
use = 'CAPNP capnp libshit',
target = 'scraps-objects')
# source can't be empty though...
ctx.program(idx = 1001,
source = 'src/scraps/main.cpp',
includes = 'src',
uselib = 'SCRAPS',
use = ['scraps-objects', 'scraps-gzip', 'scraps-js',
'scraps-tests', 'scraps-xml'],
target = 'scraps')