Skip to content

Commit

Permalink
ENH:Add subproject lib to the meson build along with meson options
Browse files Browse the repository at this point in the history
  • Loading branch information
User-DK committed Jun 19, 2024
1 parent eadee10 commit 26125af
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ project('seldon', 'cpp',

deps = []
cpp_args = ['-Wno-unused-local-typedefs', '-Wno-array-bounds']
# add_global_arguments(['-Wno-unused-local-typedefs', '-Wno-array-bounds'], language : 'cpp')

incdir = include_directories('include')
deps += [dependency('fmt'), dependency('tomlplusplus')]
Expand All @@ -19,12 +18,16 @@ sources_seldon = [
'src/util/tomlplusplus.cpp',
]

# Static library for bindings
# both static and shared library for bindings
# -----------------------------------
symbol_visibility = 'default'
symbol_visibility = 'default'
if get_option('default_library') == 'static'
# from https://github.com/ERGO-Code/HiGHS/pull/1737/files
symbol_visibility = 'inlineshidden'
endif

# only generating static library
seldon_lib = static_library('seldon',
# both libraries
seldon_lib = both_libraries('seldon',
sources_seldon,
install:true,
dependencies: deps,
Expand All @@ -35,7 +38,9 @@ seldon_lib = static_library('seldon',
)

seldon_static_dep = declare_dependency(include_directories:incdir,
link_with : seldon_lib, dependencies: deps)
link_with : seldon_lib.get_static_lib(), dependencies: deps)
seldon_shared_dep = declare_dependency(include_directories : incdir,
link_with : seldon_lib.get_shared_lib(), dependencies: deps)
# ------------------------------------

if get_option('build_exe')
Expand Down

0 comments on commit 26125af

Please sign in to comment.