build(lib_install_dir): added lib_install_dir option

this is useful for wheel builds
This commit is contained in:
2026-06-11 09:00:41 -04:00
parent 3e3b7ad5b1
commit 4ae1e30b97
3 changed files with 10 additions and 6 deletions

View File

@@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# *********************************************************************** #
project('libcomposition', 'cpp', version: 'v2.4.3', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
project('libcomposition', 'cpp', version: 'v2.4.4', 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')

View File

@@ -2,3 +2,4 @@ option('pkg_config', type: 'boolean', value: true, description: 'generate pkg-co
option('build_tests', type: 'boolean', value: true, description: 'build unit tests (uses gtest)')
option('build_examples', type: 'boolean', value: true, description: 'build example programs')
option('build_benchmarks', type: 'boolean', value: false, description: 'build benchmark 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.')

View File

@@ -37,12 +37,15 @@ dependencies = [
xxhash_dep
]
# Define the libcomposition library so it can be linked against by other parts of the build system
fourdst_component_libdir = get_option('lib_install_dir') != '' ? get_option('lib_install_dir') : get_option('libdir')
libcomposition = library('composition',
composition_sources,
cpp_args: ['-fvisibility=default'],
dependencies: dependencies,
install : true)
composition_sources,
cpp_args: ['-fvisibility=default'],
dependencies: dependencies,
install: true,
install_dir: fourdst_component_libdir)
composition_dep = declare_dependency(
link_with: libcomposition,