build(python): added fvisibility=hidden for python builds

In order to avoid massive binaries uploaded to pypi we have worked to reduce the number of symbols included in binaries
This commit is contained in:
2025-11-29 07:15:06 -05:00
parent 75a88b9720
commit a0dcfe4332
2 changed files with 12 additions and 9 deletions

View File

@@ -20,8 +20,11 @@
# *********************************************************************** #
project('GridFire', ['c', 'cpp', 'fortran'], version: 'v0.7.4_rc2', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0')
# Add default visibility for all C++ targets
if get_option('build-python')
add_project_arguments('-fvisibility=hidden', language: 'cpp')
else
add_project_arguments('-fvisibility=default', language: 'cpp')
endif
message('Found CXX compiler: ' + meson.get_compiler('cpp').get_id())
message('Found FORTRAN compiler: ' + meson.get_compiler('fortran').get_id())

View File

@@ -64,10 +64,10 @@ install_subdir('include/gridfire', install_dir: get_option('includedir'))
message('Configuring C API...')
subdir('extern')
if get_option('build-python')
message('Configuring Python bindings...')
subdir('python')
else
message('Skipping Python bindings...')
endif
#
#if get_option('build-python')
# message('Configuring Python bindings...')
# subdir('python')
#else
# message('Skipping Python bindings...')
#endif