Skip to content

Commit

Permalink
Skip building non-Python stuff in Python build
Browse files Browse the repository at this point in the history
  • Loading branch information
bmerry committed Aug 21, 2023
1 parent 5e7976f commit a9e7ae1
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 66 deletions.
14 changes: 8 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@ subdir('include/spead2') # Generates include/spead2/common_features.h and commo
include_dir = include_directories('include')
subdir('src') # Defines the targets

pkg = import('pkgconfig')
pkg.generate(
st_lib,
description : 'Library for sending and receiving data in the SPEAD protocol',
filebase : 'spead2',
)
if not get_option('python')
pkg = import('pkgconfig')
pkg.generate(
st_lib,
description : 'Library for sending and receiving data in the SPEAD protocol',
filebase : 'spead2',
)
endif
122 changes: 62 additions & 60 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -87,76 +87,78 @@ ssconfig = ss.apply(conf)

# TODO: handle debug_log user option

st_lib = static_library(
'spead2',
include_directories: include_dir,
sources: ssconfig.sources(),
dependencies: ssconfig.dependencies(),
install : true
)

st_dep = declare_dependency(
include_directories : include_dir,
sources : gen_headers,
link_with : st_lib
)

if boost_program_options_dep.found()
executable(
'spead2_recv',
'spead2_recv.cpp', 'spead2_cmdline.cpp',
dependencies : [boost_program_options_dep, st_dep],
install : true
)
executable(
'spead2_send',
'spead2_send.cpp', 'spead2_cmdline.cpp',
dependencies : [boost_program_options_dep, st_dep],
if not get_option('python')
st_lib = static_library(
'spead2',
include_directories: include_dir,
sources: ssconfig.sources(),
dependencies: ssconfig.dependencies(),
install : true
)
executable(
'spead2_bench',
'spead2_bench.cpp', 'spead2_cmdline.cpp',
dependencies : [boost_program_options_dep, st_dep],
install : true

st_dep = declare_dependency(
include_directories : include_dir,
sources : gen_headers,
link_with : st_lib
)
if use_ibv

if boost_program_options_dep.found()
executable(
'spead2_recv',
'spead2_recv.cpp', 'spead2_cmdline.cpp',
dependencies : [boost_program_options_dep, st_dep],
install : true
)
executable(
'spead2_send',
'spead2_send.cpp', 'spead2_cmdline.cpp',
dependencies : [boost_program_options_dep, st_dep],
install : true
)
executable(
'mcdump',
'mcdump.cpp',
dependencies: [boost_program_options_dep, st_dep],
'spead2_bench',
'spead2_bench.cpp', 'spead2_cmdline.cpp',
dependencies : [boost_program_options_dep, st_dep],
install : true
)
if use_ibv
executable(
'mcdump',
'mcdump.cpp',
dependencies: [boost_program_options_dep, st_dep],
install : true
)
endif
endif
endif

if cap_dep.found()
executable('spead2_net_raw', 'spead2_net_raw.cpp', dependencies : [cap_dep], install : true)
endif
if cap_dep.found()
executable('spead2_net_raw', 'spead2_net_raw.cpp', dependencies : [cap_dep], install : true)
endif

if boost_unit_test_framework_dep.found()
unit_test = executable(
'spead2_unit_test',
'unittest_main.cpp',
'unittest_logging.cpp',
'unittest_memcpy.cpp',
'unittest_memory_allocator.cpp',
'unittest_memory_pool.cpp',
'unittest_raw_packet.cpp',
'unittest_recv_live_heap.cpp',
'unittest_recv_custom_memcpy.cpp',
'unittest_recv_stream_stats.cpp',
'unittest_semaphore.cpp',
'unittest_send_heap.cpp',
'unittest_send_streambuf.cpp',
'unittest_send_tcp.cpp',
cpp_args : '-DBOOST_TEST_DYN_LINK',
dependencies : [st_dep, boost_unit_test_framework_dep]
)
test('unit tests', unit_test)
endif
if boost_unit_test_framework_dep.found()
unit_test = executable(
'spead2_unit_test',
'unittest_main.cpp',
'unittest_logging.cpp',
'unittest_memcpy.cpp',
'unittest_memory_allocator.cpp',
'unittest_memory_pool.cpp',
'unittest_raw_packet.cpp',
'unittest_recv_live_heap.cpp',
'unittest_recv_custom_memcpy.cpp',
'unittest_recv_stream_stats.cpp',
'unittest_semaphore.cpp',
'unittest_send_heap.cpp',
'unittest_send_streambuf.cpp',
'unittest_send_tcp.cpp',
cpp_args : '-DBOOST_TEST_DYN_LINK',
dependencies : [st_dep, boost_unit_test_framework_dep]
)
test('unit tests', unit_test)
endif

else # python

if get_option('python')
py_sources = files(
'py_common.cpp',
'py_recv.cpp',
Expand Down

0 comments on commit a9e7ae1

Please sign in to comment.