-
Notifications
You must be signed in to change notification settings - Fork 2
Add wrap files for xtensor-0.21.5 #3
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
project('xtensor', 'cpp', | ||
version:'0.21.5', | ||
license:'BSD-3-Clause', | ||
default_options : ['warning_level=3', 'cpp_std=c++14']) | ||
|
||
xtl_dep = dependency('xtl', | ||
version:['>=0.6.12', '<1.0.0'], | ||
fallback : ['xtl', 'xtl_dep'], | ||
required: false) | ||
|
||
json_dep = dependency('nlohmann_json', | ||
version:'>=3.1.1', | ||
fallback : ['nlohmann_json', 'nlohmann_json_dep'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fallback should not be necessary if the wrapdb is used, because of https://github.com/mesonbuild/nlohmann_json/blob/15f5c53d5fd354469fb4f801da1030ba1106161c/upstream.wrap#L9-L10 |
||
required: false) | ||
|
||
required_deps_found = xtl_dep.found() | ||
|
||
if get_option('XTENSOR_USE_XSIMD') | ||
xsimd_dep = dependency('xsimd', | ||
version: ['>=7.4.6', '<8.0.0'], | ||
fallback : ['xsimd', 'xsimd_dep'], | ||
required: false) | ||
xtensor_cpp_arg = ['-DXTENSOR_USE_XSIMD'] | ||
required_deps_found = required_deps_found and xsimd_dep.found() | ||
else | ||
xsimd_dep = dependency('', required: false) # aka "not found" | ||
xtensor_cpp_arg = [] | ||
endif | ||
|
||
if required_deps_found | ||
xtensor_dep = declare_dependency( | ||
include_directories:include_directories('include', is_system: true), | ||
dependencies: [xtl_dep, json_dep, xsimd_dep], | ||
compile_args: xtensor_cpp_arg) | ||
else | ||
xtensor_dep = dependency('', required: false) # aka "not found" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I comprehend what's going on here. Shouldn't you just make every single required dependency be, well, required, and have the subproject fail if it cannot, in fact, be successfully configured to produce the subproject's entire reason for existing? Am I missing something? |
||
endif | ||
|
||
extra_cflags = [] | ||
|
||
# Workaround from mesonbuild/meson github issue 2550 | ||
if meson.is_subproject() | ||
install_dir = get_option('subproj_includedir') | ||
extra_cflags += '-I' + get_option('prefix') / install_dir | ||
else | ||
install_dir = get_option('includedir') | ||
endif | ||
|
||
install_subdir('include/xtensor', install_dir: install_dir) | ||
|
||
pkgconfig = import('pkgconfig') | ||
pkgconfig.generate(name: meson.project_name(), | ||
version: meson.project_version(), | ||
description: 'xtensor is a C++ library meant for numerical analysis with multi-dimensional array expressions.', | ||
extra_cflags: extra_cflags) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
option('XTENSOR_USE_XSIMD', type: 'boolean', value: false, description: 'simd acceleration for xtensor') | ||
option('subproj_includedir', | ||
type: 'string', | ||
value: 'include', | ||
description: 'Header file directory when built as subproject', | ||
yield: true) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[wrap-file] | ||
directory=xtensor-0.21.5 | ||
|
||
source_url=https://github.com/xtensor-stack/xtensor/archive/0.21.5.zip | ||
source_filename=xtensor-0.21.5.zip | ||
source_hash=f08aca41dc89128524dec04c82b590d9e0f1e923311e82bab9f024c99e7bb73a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs to add https://mesonbuild.com/Wrap-dependency-system-manual.html#provide-section Upstream provides https://github.com/xtensor-stack/xtensor/blob/master/xtensor.pc.in so users should be able to dependency('xtensor') and the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise here, if mesonbuild/quantstack-xtl#1 includes a provide section, you should not need an explicit fallback.