From b08ab17cd676273411fa53f3b3f89f385d80c8c6 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Thu, 11 Jun 2026 09:03:09 -0400 Subject: [PATCH] build(lib_install_dir): added lib_install_dir option This option overrides where reflect-cpp is installed. This is useful for wheel builds --- build-config/reflect-cpp/meson.build | 16 +++++++++------- meson_options.txt | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/build-config/reflect-cpp/meson.build b/build-config/reflect-cpp/meson.build index 1d72612..3eb013b 100644 --- a/build-config/reflect-cpp/meson.build +++ b/build-config/reflect-cpp/meson.build @@ -16,13 +16,15 @@ reflect_cpp_sources = files( reflect_cpp_include_dirs = include_directories('include') -reflect_cpp_library = static_library( - 'reflect_cpp', - reflect_cpp_sources, - include_directories: [reflect_cpp_include_dirs, tomlpp_inc_dir], - install: true, - install_dir: get_option('libdir') / 'fourdst' / 'vendor', -) +reflect_cpp_install_dir = get_option('lib_install_dir') != '' \ + ? get_option('lib_install_dir') / 'vendor' \ + : get_option('libdir') / 'fourdst' / 'vendor' + +reflect_cpp_library = static_library('reflect_cpp', + reflect_cpp_sources, + include_directories: [reflect_cpp_include_dirs, tomlpp_inc_dir], + install: true, + install_dir: reflect_cpp_install_dir) reflect_cpp_dep = declare_dependency( link_with: reflect_cpp_library, diff --git a/meson_options.txt b/meson_options.txt index 0fc180a..83c7264 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,5 @@ option('pkg_config', type: 'boolean', value: true, description: 'generate pkg-config file for libconfig (fourdst_config.pc)') option('build_tests', type: 'boolean', value: true, description: 'Build unit and integration tests (uses gtest)') option('build_examples', type: 'boolean', value: true, description: 'Build simple example programs') +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.'):w +