diff --git a/LICENSE.build b/LICENSE.build deleted file mode 100644 index 1a3d60c..0000000 --- a/LICENSE.build +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2019 The Meson development team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..37cd705 --- /dev/null +++ b/meson.build @@ -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'], + 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" +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) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..9aac9c4 --- /dev/null +++ b/meson_options.txt @@ -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) diff --git a/upstream.wrap b/upstream.wrap new file mode 100644 index 0000000..e88aabd --- /dev/null +++ b/upstream.wrap @@ -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