build(lib_install_dir): added lib_install_dir option

This option overrides where reflect-cpp is installed. This is useful for wheel builds
This commit is contained in:
2026-06-11 09:03:09 -04:00
parent f67e164280
commit b08ab17cd6
2 changed files with 11 additions and 7 deletions

View File

@@ -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,

View File

@@ -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