Compare commits

..

3 Commits

Author SHA1 Message Date
11ed6d5a0f fix(rpath): fixed macos RPATH bug 2026-06-11 12:21:32 -04:00
e88d89e71e build(meson): more robust python build mode 2026-06-11 10:56:54 -04:00
92795f8f5a build(header_install_dir): added header_install_dir option
this is useful for wheel builds
2026-06-11 09:36:34 -04:00
7 changed files with 51 additions and 20 deletions

View File

@@ -48,7 +48,7 @@ PROJECT_NAME = libconfig
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = v2.2.7
PROJECT_NUMBER = v2.2.10
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewers a

View File

@@ -4,5 +4,10 @@ cli11_dep = cli11_proj.get_variable('CLI11_dep')
cli11_headers = cli11_proj.get_variable('cli11_headers')
cli11_impl_headers = cli11_proj.get_variable('cli11_impl_headers')
install_headers(cli11_headers, subdir: 'fourdst/vendor/CLI')
install_headers(cli11_impl_headers, subdir: 'fourdst/vendor/CLI/impl')
if get_option('build_python')
install_data(cli11_headers, install_dir: vendor_header_dir / 'CLI')
install_data(cli11_impl_headers, install_dir: vendor_header_dir / 'CLI' / 'impl')
else
install_headers(cli11_headers, install_dir: vendor_header_dir / 'CLI')
install_headers(cli11_impl_headers, install_dir: vendor_header_dir / 'CLI' / 'impl')
endif

View File

@@ -16,15 +16,11 @@ reflect_cpp_sources = files(
reflect_cpp_include_dirs = include_directories('include')
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)
install_dir: vendor_lib_dir)
reflect_cpp_dep = declare_dependency(
link_with: reflect_cpp_library,
@@ -33,6 +29,6 @@ reflect_cpp_dep = declare_dependency(
install_subdir(
'include',
install_dir: get_option('includedir') / 'fourdst' / 'vendor',
strip_directory: true
install_dir: vendor_header_dir,
strip_directory: true,
)

View File

@@ -2,8 +2,7 @@ tomlpp_inc_dir = include_directories('vendor/include')
install_subdir(
'vendor/include',
install_dir: get_option('includedir') / 'fourdst' / 'vendor',
strip_directory: true
install_dir: vendor_header_dir,
strip_directory: true,
exclude_files: ['meson.build'],
)

View File

@@ -18,11 +18,36 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# *********************************************************************** #
project('libconfig', ['cpp', 'c'], version: 'v2.2.7', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
project('libconfig', ['cpp', 'c'], version: 'v2.2.10', 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')
if get_option('build_python')
local_py_install = import('python').find_installation('python3', pure: false)
fourdst_pkg = local_py_install.get_install_dir() / 'fourdst'
config_libdir = fourdst_pkg / 'lib'
config_header_install_dir = fourdst_pkg / 'include' / 'fourdst' / 'config'
vendor_lib_dir = fourdst_pkg / 'lib' / 'vendor'
vendor_header_dir = fourdst_pkg / 'include' / 'fourdst' / 'vendor'
message('Installing libconfig in python mode. Install locations are...')
else
config_libdir = get_option('libdir')
config_header_install_dir = get_option('includedir') / 'fourdst' / 'config'
vendor_lib_dir = get_option('libdir') / 'fourdst' / 'vendor'
vendor_header_dir = get_option('includedir') / 'fourdst' / 'vendor'
message('Installing libconfig in non python (normal) mode. Install locations are...')
endif
message(' Package Libraries: ' + config_libdir)
message(' Package Headers: ' + config_header_install_dir)
message(' Vendor Libraries: ' + vendor_lib_dir)
message(' Vendor Headers: ' + vendor_header_dir)
cpp = meson.get_compiler('cpp')
subdir('build-config')
subdir('src')
@@ -38,8 +63,7 @@ endif
if get_option('pkg_config')
message('Generating pkg-config file for libconfig...')
vendor_inc_flags = '-I${includedir}' / 'fourdst' / 'vendor'
vendor_inc_flags = '-I' + get_option('prefix') / vendor_header_dir
pkg = import('pkgconfig')
pkg.generate(
name: 'libconfig',

View File

@@ -1,5 +1,7 @@
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
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.')
option('build_python', type: 'boolean', value: false, description: 'Build in python mode. Note that this does not generate a wheel; rather, this is the appropriate option to turn on when packaging this component inside of a wheel.')

View File

@@ -13,10 +13,15 @@ config_headers = files(
'include/fourdst/config/ansi.h',
'include/fourdst/config/validate.h',
)
install_headers(config_headers, subdir : 'fourdst/config')
config_exception_headers = files(
'include/fourdst/config/exceptions/exceptions.h',
)
install_headers(config_exception_headers, subdir : 'fourdst/config/exceptions')
if get_option('build_python')
install_data(config_headers, install_dir: config_header_install_dir)
install_data(config_exception_headers, install_dir: config_header_install_dir / 'exceptions')
else
install_headers(config_headers, install_dir: config_header_install_dir)
install_headers(config_exception_headers, install_dir: config_header_install_dir / 'exceptions')
endif