project('DECS', 'd')

src = [
	'source/bubel/ecs/atomic.d',
	'source/bubel/ecs/attributes.d',
	'source/bubel/ecs/block_allocator.d',
	'source/bubel/ecs/core.d',
	'source/bubel/ecs/entity.d',
	'source/bubel/ecs/events.d',
	'source/bubel/ecs/hash_map.d',
	'source/bubel/ecs/id_manager.d',
	'source/bubel/ecs/manager.d',
	'source/bubel/ecs/package.d',
	'source/bubel/ecs/simple_vector.d',
	'source/bubel/ecs/std.d',
	'source/bubel/ecs/system.d',
	'source/bubel/ecs/traits.d',
	'source/bubel/ecs/vector.d'
]

tests_src = [
	'tests/tests.d'
]

betterC_opt = get_option('betterC')

comp = meson.get_compiler('d')

comp_id = comp.get_id()

args = []
link_args = []

if betterC_opt
	args += '-betterC'
	link_args += '-betterC'
endif

inc = include_directories('source/')
tests_inc = include_directories('source/')

ecs_lib = shared_library('ecs', src, include_directories : [tests_inc, inc], d_args: args, link_args: link_args)

executable('tests', tests_src, include_directories : [tests_inc, inc], d_args: args, link_args: link_args, link_with: ecs_lib)


