2025-08-15 12:11:32 -04:00
|
|
|
cmake = import('cmake')
|
|
|
|
|
cvode_cmake_options = cmake.subproject_options()
|
|
|
|
|
|
|
|
|
|
cvode_cmake_options.add_cmake_defines({
|
|
|
|
|
'CMAKE_CXX_FLAGS' : '-Wno-deprecated-declarations',
|
|
|
|
|
'CMAKE_C_FLAGS' : '-Wno-deprecated-declarations',
|
2025-12-01 09:59:22 -05:00
|
|
|
'BUILD_SHARED_LIBS' : 'OFF',
|
|
|
|
|
'BUILD_STATIC_LIBS' : 'ON',
|
|
|
|
|
'EXAMPLES_ENABLE_C': 'OFF',
|
2025-12-01 13:28:25 -05:00
|
|
|
'CMAKE_POSITION_INDEPENDENT_CODE': true
|
2025-08-15 12:11:32 -04:00
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
cvode_cmake_options.add_cmake_defines({
|
|
|
|
|
'CMAKE_INSTALL_LIBDIR': get_option('libdir'),
|
|
|
|
|
'CMAKE_INSTALL_INCLUDEDIR': get_option('includedir')
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
cvode_sp = cmake.subproject(
|
|
|
|
|
'cvode',
|
|
|
|
|
options: cvode_cmake_options,
|
|
|
|
|
)
|
|
|
|
|
|
2025-12-01 13:28:25 -05:00
|
|
|
sundials_core_tgt = cvode_sp.target('sundials_core_static')
|
|
|
|
|
sundials_cvode_tgt = cvode_sp.target('sundials_cvode_static')
|
|
|
|
|
sundials_nvecserial_tgt = cvode_sp.target('sundials_nvecserial_static')
|
|
|
|
|
sundials_sunmatrixdense_tgt = cvode_sp.target('sundials_sunmatrixdense_static')
|
|
|
|
|
sundials_sunlinsoldense_tgt = cvode_sp.target('sundials_sunlinsoldense_static')
|
2025-08-15 12:11:32 -04:00
|
|
|
|
2025-12-01 13:28:25 -05:00
|
|
|
cvode_objs = [
|
|
|
|
|
sundials_core_tgt.extract_all_objects(recursive: true),
|
|
|
|
|
sundials_cvode_tgt.extract_all_objects(recursive: true),
|
|
|
|
|
sundials_nvecserial_tgt.extract_all_objects(recursive: true),
|
|
|
|
|
sundials_sunmatrixdense_tgt.extract_all_objects(recursive: true),
|
|
|
|
|
sundials_sunlinsoldense_tgt.extract_all_objects(recursive: true),
|
|
|
|
|
]
|
2025-08-15 12:11:32 -04:00
|
|
|
|
2025-12-01 13:28:25 -05:00
|
|
|
sundials_core_includes = cvode_sp.include_directories('sundials_core_static')
|
|
|
|
|
sundials_cvode_includes = cvode_sp.include_directories('sundials_cvode_static')
|
|
|
|
|
sundials_nvecserial_includes = cvode_sp.include_directories('sundials_nvecserial_static')
|
|
|
|
|
sundials_sunmatrixdense_includes = cvode_sp.include_directories('sundials_sunmatrixdense_static')
|
|
|
|
|
sundials_sunlinsoldense_includes = cvode_sp.include_directories('sundials_sunlinsoldense_static')
|
2025-08-15 12:11:32 -04:00
|
|
|
|
2025-12-01 13:28:25 -05:00
|
|
|
cvode_includes = [
|
|
|
|
|
sundials_core_includes,
|
|
|
|
|
sundials_cvode_includes,
|
|
|
|
|
sundials_nvecserial_includes,
|
|
|
|
|
sundials_sunmatrixdense_includes,
|
|
|
|
|
sundials_sunlinsoldense_includes
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
empty_cvode_file = configure_file(
|
|
|
|
|
output: 'cvode_dummy_ar.cpp',
|
|
|
|
|
command: ['echo'],
|
|
|
|
|
capture: true
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
libcvode_static = static_library(
|
|
|
|
|
'cvode-static',
|
|
|
|
|
empty_cvode_file,
|
|
|
|
|
objects: cvode_objs,
|
|
|
|
|
include_directories: cvode_includes,
|
|
|
|
|
pic: true,
|
|
|
|
|
install: false
|
|
|
|
|
)
|
2025-08-15 12:11:32 -04:00
|
|
|
|
|
|
|
|
|
2025-11-19 12:06:21 -05:00
|
|
|
cvode_dep = declare_dependency(
|
2025-12-01 13:28:25 -05:00
|
|
|
link_with: libcvode_static,
|
|
|
|
|
include_directories: cvode_includes,
|
2025-08-15 12:11:32 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|