build(wasm): major progress on gridfire compiling to wasm

This commit is contained in:
2025-12-03 11:38:08 -05:00
parent d852ee43fe
commit 7242c765f3
20 changed files with 295 additions and 250 deletions

View File

@@ -1,17 +1,21 @@
# bring in all of the fourdst utility repositories
fourdst_build_lib_all = true
if get_option('unity-safe')
if not get_option('plugin_support')
fourdst_build_lib_all=false
message('Disabling fourdst plugin support as per user request.')
endif
fourdst_sp = subproject('fourdst',
default_options:
['build-tests=' + get_option('build-tests').to_string(),
'build-python=' + get_option('build-python').to_string(),
'build-lib-all=' + fourdst_build_lib_all.to_string(),
'pkg-config=' + get_option('pkg-config').to_string(),
'build-lib-log=true'
['build_tests=' + get_option('build_tests').to_string(),
'build_python=' + get_option('build_python').to_string(),
'build_lib_all=' + fourdst_build_lib_all.to_string(),
'build_lib_comp=true',
'build_lib_config=true',
'build_lib_log=true',
'build_lib_const=true',
'pkg_config=' + get_option('pkg_config').to_string(),
]
)
@@ -19,7 +23,8 @@ composition_dep = fourdst_sp.get_variable('composition_dep')
log_dep = fourdst_sp.get_variable('log_dep')
const_dep = fourdst_sp.get_variable('const_dep')
config_dep = fourdst_sp.get_variable('config_dep')
if not get_option('unity-safe')
if get_option('plugin_support')
warning('Including plugin library from fourdst. Note this will bring in minizip-ng and openssl, which can cause build issues with cross compilation due to their complexity.')
plugin_dep = fourdst_sp.get_variable('plugin_dep')
endif
@@ -28,6 +33,7 @@ libconst = fourdst_sp.get_variable('libconst')
libconfig = fourdst_sp.get_variable('libconfig')
liblogging = fourdst_sp.get_variable('liblogging')
if not get_option('unity-safe')
if get_option('plugin_support')
warning('Including plugin library from fourdst. Note this will bring in minizip-ng and openssl, which can cause build issues with cross compilation due to their complexity.')
libplugin = fourdst_sp.get_variable('libplugin')
endif

View File

@@ -1,7 +1,9 @@
cmake = import('cmake')
subdir('python')
if get_option('build_python')
subdir('python')
subdir('pybind')
endif
subdir('fourdst')
subdir('sundials')
@@ -11,6 +13,5 @@ subdir('eigen')
subdir('json')
subdir('pybind')
subdir('CLI11')

View File

@@ -1,3 +1,3 @@
pybind11_proj = subproject('pybind11')
pybind11_dep = pybind11_proj.get_variable('pybind11_dep')
python3_dep = dependency('python3')
python3_dep = dependency('python3')

View File

@@ -6,7 +6,7 @@ cvode_cmake_options.add_cmake_defines({
'CMAKE_C_FLAGS' : '-Wno-deprecated-declarations',
'BUILD_SHARED_LIBS' : 'OFF',
'BUILD_STATIC_LIBS' : 'ON',
'EXAMPLES_ENABLE_C': 'OFF',
'EXAMPLES_ENABLE_C' : 'OFF',
'CMAKE_POSITION_INDEPENDENT_CODE': true
})
@@ -16,6 +16,15 @@ cvode_cmake_options.add_cmake_defines({
'CMAKE_INSTALL_INCLUDEDIR': get_option('includedir')
})
if meson.is_cross_build() and host_machine.system() == 'emscripten'
cvode_cmake_options.add_cmake_defines({
'CMAKE_C_FLAGS': '-s MEMORY64=1 -s ALLOW_MEMORY_GROWTH=1',
'CMAKE_CXX_FLAGS': '-s MEMORY64=1 -s ALLOW_MEMORY_GROWTH=1',
'CMAKE_SHARED_LINKER_FLAGS': '-s MEMORY64=1 -s ALLOW_MEMORY_GROWTH=1',
'CMAKE_EXE_LINKER_FLAGS': '-s MEMORY64=1 -s ALLOW_MEMORY_GROWTH=1'
})
endif
cvode_sp = cmake.subproject(
'cvode',
options: cvode_cmake_options,

View File

@@ -1,4 +1,4 @@
xxhash_dep = declare_dependency(
include_directories: include_directories('include')
)
)