2025-07-23 16:26:30 -04:00
|
|
|
# --- Python Extension Setup ---
|
2025-11-25 14:08:58 -05:00
|
|
|
py_installation = import('python').find_installation('python3', pure: false)
|
2025-07-23 16:26:30 -04:00
|
|
|
|
2025-11-03 08:38:21 -05:00
|
|
|
gridfire_py_deps = [
|
|
|
|
|
pybind11_dep,
|
|
|
|
|
const_dep,
|
|
|
|
|
config_dep,
|
|
|
|
|
composition_dep,
|
|
|
|
|
gridfire_dep
|
|
|
|
|
]
|
|
|
|
|
|
2025-07-23 16:26:30 -04:00
|
|
|
py_mod = py_installation.extension_module(
|
2025-11-25 14:08:58 -05:00
|
|
|
'_gridfire', # Name of the generated .so/.pyd file (without extension)
|
2025-07-23 16:26:30 -04:00
|
|
|
sources: [
|
|
|
|
|
meson.project_source_root() + '/src/python/bindings.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/types/bindings.cpp',
|
2025-11-03 15:10:03 -05:00
|
|
|
meson.project_source_root() + '/src/python/partition/bindings.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/partition/trampoline/py_partition.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/reaction/bindings.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/screening/bindings.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/screening/trampoline/py_screening.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/io/bindings.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/io/trampoline/py_io.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/exceptions/bindings.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/engine/bindings.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/engine/trampoline/py_engine.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/solver/bindings.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/solver/trampoline/py_solver.cpp',
|
2025-11-25 14:08:58 -05:00
|
|
|
meson.project_source_root() + '/src/python/policy/bindings.cpp',
|
|
|
|
|
meson.project_source_root() + '/src/python/policy/trampoline/py_policy.cpp',
|
2025-11-03 15:10:03 -05:00
|
|
|
meson.project_source_root() + '/src/python/utils/bindings.cpp',
|
2025-07-23 16:26:30 -04:00
|
|
|
],
|
2025-11-03 08:38:21 -05:00
|
|
|
dependencies : gridfire_py_deps,
|
2025-07-23 16:26:30 -04:00
|
|
|
cpp_args : ['-UNDEBUG'], # Example: Ensure assertions are enabled if needed
|
|
|
|
|
install : true,
|
2025-11-25 14:08:58 -05:00
|
|
|
subdir: 'gridfire',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
py_installation.install_sources(
|
|
|
|
|
files(
|
|
|
|
|
meson.project_source_root() + '/src/python/gridfire/__init__.py',
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/__init__.pyi',
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/exceptions.pyi',
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/partition.pyi',
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/reaction.pyi',
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/screening.pyi',
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/io.pyi',
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/solver.pyi',
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/policy.pyi',
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/type.pyi'
|
|
|
|
|
),
|
|
|
|
|
subdir: 'gridfire',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
py_installation.install_sources(
|
|
|
|
|
files(
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/engine/__init__.pyi',
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/engine/diagnostics.pyi',
|
|
|
|
|
),
|
|
|
|
|
subdir: 'gridfire/engine',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
py_installation.install_sources(
|
|
|
|
|
files(
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/__init__.pyi',
|
|
|
|
|
),
|
|
|
|
|
subdir: 'gridfire/utils',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
py_installation.install_sources(
|
|
|
|
|
files(
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/hashing/__init__.pyi',
|
|
|
|
|
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/hashing/reaction.pyi',
|
|
|
|
|
),
|
|
|
|
|
subdir: 'gridfire/utils/hashing',
|
|
|
|
|
)
|