From 86f10d15211138a626003ded6cb9c66eb949a2b6 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Thu, 11 Jun 2026 09:39:15 -0400 Subject: [PATCH] build(header_install_dir): added header_install_dir option this option is useful for wheel builds --- meson.build | 2 +- meson_options.txt | 3 ++- src/constants/meson.build | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index e73b22b..578a618 100644 --- a/meson.build +++ b/meson.build @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # *********************************************************************** # -project('libconstants', 'cpp', version: 'v1.1.4', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0') +project('libconstants', 'cpp', version: 'v1.1.5', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0') # Add default visibility for all C++ targets add_project_arguments('-fvisibility=default', language: 'cpp') diff --git a/meson_options.txt b/meson_options.txt index c59990f..1c193f1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,4 +1,5 @@ option('pkg_config', type: 'boolean', value: true, description: 'generate pkg-config file for libconstants (fourdst_constants.pc)') option('build_tests', type: 'boolean', value: true, description: 'control if tests are built or not') option('build_examples', type: 'boolean', value: true, description: 'control if examples is built or not') -option('lib_install_dir', type: 'string', value: '', description: 'Override install dir for the shared library (used by the fourdst umbrella to place libs inside the Python package in wheel builds). Empty = default libdir.') \ No newline at end of file +option('lib_install_dir', type: 'string', value: '', description: 'Override install dir for the shared library (used by the fourdst umbrella to place libs inside the Python package in wheel builds). Empty = default libdir.') +option('header_install_dir', type: 'string', value: '', description: 'Override the header install root (used by the fourdst umbrella to place headers inside the Python package in wheel builds). Empty = default includedir.') \ No newline at end of file diff --git a/src/constants/meson.build b/src/constants/meson.build index bbf1547..80676d1 100644 --- a/src/constants/meson.build +++ b/src/constants/meson.build @@ -23,4 +23,9 @@ const_dep = declare_dependency( const_headers = files( 'include/fourdst/constants/const.h' ) -install_headers(const_headers, subdir : 'fourdst/constants') + + +constants_header_install_dir = get_option('header_install_dir') != '' \ + ? get_option('header_install_dir') / 'fourdst' / 'constants' \ + : get_option('includedir') / 'fourdst' / 'constants' +install_headers(const_headers, install_dir: constants_header_install_dir)