From ab2ae12281653f10a04f70d451270da6e3d86398 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Fri, 28 Nov 2025 11:00:51 -0500 Subject: [PATCH] feat(meson): More granular build options fourdst's build system now exposes some options to allow fine grained control of what is built and what is not --- build-config/meson.build | 25 +++++++++++++++++++------ meson.build | 9 +++++---- meson_options.txt | 9 ++++++++- subprojects/libplugin.wrap | 2 +- 4 files changed, 33 insertions(+), 12 deletions(-) diff --git a/build-config/meson.build b/build-config/meson.build index e2f2e28..1fb9a89 100644 --- a/build-config/meson.build +++ b/build-config/meson.build @@ -1,6 +1,19 @@ -subdir('libcomposition') -subdir('libconfig') -subdir('libconstants') -subdir('liblogging') -subdir('libplugin') -subdir('pybind') +if get_option('build-lib-comp') or get_option('build-lib-all') or get_option('build-python') + subdir('libcomposition') +endif +if get_option('build-lib-config') or get_option('build-lib-all') or get_option('build-python') + subdir('libconfig') +endif +if get_option('build-lib-const') or get_option('build-lib-all') or get_option('build-python') + subdir('libconstants') +endif +if get_option('build-lib-log') or get_option('build-lib-all') + subdir('liblogging') +endif +if get_option('build-lib-plugin') or get_option('build-lib-all') + subdir('libplugin') +endif + +if get_option('build-python') + subdir('pybind') +endif diff --git a/meson.build b/meson.build index bc4498f..5f22003 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('fourdst', 'cpp', version: 'v0.9.8', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0') +project('fourdst', 'cpp', version: 'v0.9.9', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0') add_project_arguments('-fvisibility=default', language: 'cpp') @@ -12,8 +12,9 @@ endif subdir('build-config') # Configure python bindings -subdir('build-python') +if get_option('build-python') + subdir('build-python') -# Build python bindings -subdir('src-pybind') + subdir('src-pybind') +endif diff --git a/meson_options.txt b/meson_options.txt index 71d889c..72e1a46 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,10 @@ option('pkg-config', type: 'boolean', value: false, description: 'generate pkg-config file for all libraries and fourdst (defaults to false to allow easy pip building)') option('electron-build-py-backend', type: 'boolean', value: false, description: 'use pyinstaller to build the python backend for the electron app') -option('tests', type: 'boolean', value: false, description: 'compile subproject tests') +option('build-tests', type: 'boolean', value: false, description: 'compile subproject tests') +option('build-lib-all', type: 'boolean', value: true, description: 'build the full fourdst library with all features enabled') +option('build-lib-comp', type: 'boolean', value: false, description: 'build the minimal fourdst library with only compression and decompression features enabled') +option('build-lib-config', type: 'boolean', value: false, description: 'build the fourdst library configuration tool only') +option('build-lib-const', type: 'boolean', value: false, description: 'build the fourdst library constants only') +option('build-python', type: 'boolean', value: true, description: 'build the python bindings so you can use fourdst from python. This will also build libcomposition, libconfig, and libconstants') +option('build-lib-log', type: 'boolean', value: false, description: 'build the fourdst library logging features only') +option('build-lib-plugin', type: 'boolean', value: false, description: 'build the fourdst plugin module only') diff --git a/subprojects/libplugin.wrap b/subprojects/libplugin.wrap index d8f8754..87dc556 100644 --- a/subprojects/libplugin.wrap +++ b/subprojects/libplugin.wrap @@ -1,4 +1,4 @@ [wrap-git] url = https://github.com/4D-STAR/libplugin.git -revision = v0.3.5 +revision = v0.3.6 depth = 1