Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates meson.build #37

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 17 additions & 66 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,91 +1,42 @@
project('stdx-allocator', 'd',
meson_version: '>=0.45',
project('stdx-allocator', ['d'],
meson_version: '>=1.3.1',
license: 'BSL-1.0',
version: '3.0.1'
version: 'v3.1.0'
)

project_soversion = '0'

mir_core_dep = dependency('mir-core', fallback : ['mir-core', 'mir_core_dep'])

required_deps = [mir_core_dep]
subdir('source/')

pkgc = import('pkgconfig')

#
# Sources
#
allocator_src = [
'source/stdx/allocator/internal.d',
'source/stdx/allocator/building_blocks/null_allocator.d',
'source/stdx/allocator/building_blocks/fallback_allocator.d',
'source/stdx/allocator/building_blocks/bitmapped_block.d',
'source/stdx/allocator/building_blocks/stats_collector.d',
'source/stdx/allocator/building_blocks/package.d',
'source/stdx/allocator/building_blocks/affix_allocator.d',
'source/stdx/allocator/building_blocks/free_list.d',
'source/stdx/allocator/building_blocks/bucketizer.d',
'source/stdx/allocator/building_blocks/free_tree.d',
'source/stdx/allocator/building_blocks/kernighan_ritchie.d',
'source/stdx/allocator/building_blocks/allocator_list.d',
'source/stdx/allocator/building_blocks/segregator.d',
'source/stdx/allocator/building_blocks/scoped_allocator.d',
'source/stdx/allocator/building_blocks/region.d',
'source/stdx/allocator/building_blocks/quantizer.d',
'source/stdx/allocator/typed.d',
'source/stdx/allocator/mmap_allocator.d',
'source/stdx/allocator/showcase.d',
'source/stdx/allocator/mallocator.d',
'source/stdx/allocator/package.d',
'source/stdx/allocator/common.d',
'source/stdx/allocator/gc_allocator.d',
]
mir_core_dep = dependency('mir-core', fallback : ['mir-core', 'mir_core_dep'])

src_dir = include_directories('source/')
allocator_internal_dep = declare_dependency(
include_directories: allocator_include,
sources: allocator_src,
dependencies: mir_core_dep,
version: meson.project_version(),
)

#
# Targets
#
allocator_lib = library('stdx-allocator',
[allocator_src],
include_directories: [src_dir],
install: true,
version: meson.project_version(),
soversion: project_soversion,
dependencies: required_deps,
dependencies: allocator_internal_dep,
install: true,
soversion: project_soversion,
)

#
# Tests
#
allocator_test_exe = executable(meson.project_name() + '-test',
allocator_src,
include_directories: src_dir,
dependencies: allocator_internal_dep,
d_unittest: true,
link_args: '-main',
dependencies: required_deps,

link_with: allocator_lib
)

# for use by Vibe.d and others which embed this as subproject
allocator_dep = declare_dependency(
dependencies: allocator_internal_dep,
link_with: allocator_lib,
include_directories: src_dir,
dependencies: required_deps,
)

#
# Install
#
install_subdir('source/stdx/', install_dir: 'include/d/stdx-allocator/')


pkgc.generate(name: 'stdx-allocator',
libraries: allocator_lib,
requires: ['mir-core'],
subdirs: 'd/' + meson.project_name(),
version: meson.project_version(),
description: 'High-level interface for allocators for D, extracted from Phobos.'
)

test(meson.project_name() + '-test', allocator_test_exe)
27 changes: 27 additions & 0 deletions source/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
allocator_src = files(
'stdx/allocator/internal.d',
'stdx/allocator/building_blocks/null_allocator.d',
'stdx/allocator/building_blocks/fallback_allocator.d',
'stdx/allocator/building_blocks/bitmapped_block.d',
'stdx/allocator/building_blocks/stats_collector.d',
'stdx/allocator/building_blocks/package.d',
'stdx/allocator/building_blocks/affix_allocator.d',
'stdx/allocator/building_blocks/free_list.d',
'stdx/allocator/building_blocks/bucketizer.d',
'stdx/allocator/building_blocks/free_tree.d',
'stdx/allocator/building_blocks/kernighan_ritchie.d',
'stdx/allocator/building_blocks/allocator_list.d',
'stdx/allocator/building_blocks/segregator.d',
'stdx/allocator/building_blocks/scoped_allocator.d',
'stdx/allocator/building_blocks/region.d',
'stdx/allocator/building_blocks/quantizer.d',
'stdx/allocator/typed.d',
'stdx/allocator/mmap_allocator.d',
'stdx/allocator/showcase.d',
'stdx/allocator/mallocator.d',
'stdx/allocator/package.d',
'stdx/allocator/common.d',
'stdx/allocator/gc_allocator.d',
)

allocator_include = include_directories('.')
4 changes: 0 additions & 4 deletions subprojects/mir-core.wrap

This file was deleted.