build(lib_install_dir): added lib_install_dir option

this option is useful for wheel builds
This commit is contained in:
2026-06-11 09:07:04 -04:00
parent 5753e2cc74
commit caf48f4590
3 changed files with 5 additions and 2 deletions

View File

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

@@ -1,3 +1,4 @@
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.')

View File

@@ -5,12 +5,14 @@ const_sources = files(
# Define the libconst 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')
libconst = library('const',
const_sources,
include_directories: include_directories('include'),
cpp_args: ['-fvisibility=default'],
dependencies: [const_data_dep],
install : true)
install : true,
install_dir: fourdst_component_libdir)
const_dep = declare_dependency(
include_directories: include_directories('include'),