diff --git a/docs/pages/guides/packaging_compiled.md b/docs/pages/guides/packaging_compiled.md index d270c3f9..6bcaa980 100644 --- a/docs/pages/guides/packaging_compiled.md +++ b/docs/pages/guides/packaging_compiled.md @@ -132,39 +132,27 @@ with code_fence("meson"): ```meson project( - 'package', - 'cpp', - version: '0.1.0', - license: 'BSD', - meson_version: '>= 0.64.0', - default_options: [ - 'buildtype=debugoptimized', - 'cpp_std=c++11', - ], + 'package', + 'cpp', + version: '0.1.0', + license: 'BSD', + meson_version: '>= 1.1.0', + default_options: [ + 'cpp_std=c++11', + ], ) -name = 'package' -py_mod = import('python') -py = py_mod.find_installation(pure: false) - -pybind11_config = find_program('pybind11-config') -pybind11_config_ret = run_command(pybind11_config, ['--includes'], check: true) -pybind11 = declare_dependency( - include_directories: [pybind11_config_ret.stdout().split('-I')[-1].strip()], -) - -install_subdir('src' / name, install_dir: py.get_install_dir() / name, strip_directory: true) +py = import('python').find_installation(pure: false) +pybind11_dep = dependency('pybind11') py.extension_module('_core', 'src/main.cpp', subdir: 'package', install: true, - dependencies : [pybind11], - link_language : 'cpp', - override_options: [ - 'cpp_rtti=true', - ] + dependencies : [pybind11_dep], ) + +install_subdir('src/package', install_dir: py.get_install_dir() / 'package', strip_directory: true) ``` diff --git a/{{cookiecutter.project_name}}/{% if cookiecutter.backend=='mesonpy' %}meson.build{% endif %} b/{{cookiecutter.project_name}}/{% if cookiecutter.backend=='mesonpy' %}meson.build{% endif %} index b77cf88f..cc8eb4a4 100644 --- a/{{cookiecutter.project_name}}/{% if cookiecutter.backend=='mesonpy' %}meson.build{% endif %} +++ b/{{cookiecutter.project_name}}/{% if cookiecutter.backend=='mesonpy' %}meson.build{% endif %} @@ -1,34 +1,22 @@ project( - '{{ cookiecutter.__project_slug }}', - 'cpp', - version: '0.1.0', - license: '{{ cookiecutter.license }}', - meson_version: '>= 0.64.0', - default_options: [ - 'buildtype=debugoptimized', - 'cpp_std=c++11', - ], + '{{ cookiecutter.__project_slug }}', + 'cpp', + version: '0.1.0', + license: 'BSD', + meson_version: '>= 1.1.0', + default_options: [ + 'cpp_std=c++11', + ], ) -name = '{{ cookiecutter.__project_slug }}' -py_mod = import('python') -py = py_mod.find_installation(pure: false) - -pybind11_config = find_program('pybind11-config') -pybind11_config_ret = run_command(pybind11_config, ['--includes'], check: true) -pybind11 = declare_dependency( - include_directories: [pybind11_config_ret.stdout().split('-I')[-1].strip()], -) - -install_subdir('src' / name, install_dir: py.get_install_dir() / name, strip_directory: true) +py = import('python').find_installation(pure: false) +pybind11_dep = dependency('pybind11') py.extension_module('_core', 'src/main.cpp', subdir: '{{ cookiecutter.__project_slug }}', install: true, - dependencies : [pybind11], - link_language : 'cpp', - override_options: [ - 'cpp_rtti=true', - ] + dependencies : [pybind11_dep], ) + +install_subdir('src/{{ cookiecutter.__project_slug }}', install_dir: py.get_install_dir() / '{{ cookiecutter.__project_slug }}', strip_directory: true)